Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$store =doesn't check whether store is different in current scope #5048

Closed
pushkine opened this issue Jun 21, 2020 · 2 comments · Fixed by #5079
Closed

$store =doesn't check whether store is different in current scope #5048

pushkine opened this issue Jun 21, 2020 · 2 comments · Fixed by #5079
Labels

Comments

@pushkine
Copy link
Contributor

https://svelte.dev/repl/8b351c8352044772a0561cc56a5f85a2?version=3.23.2

	const click_handler = store => {
		set_store_value(store, $store = Math.random());
	};

Error: store.set is not a function

@antony antony added the bug label Jun 21, 2020
@Conduitry
Copy link
Member

This seems niche enough that we should probably just check the scope at compile time and throw an exception, rather than getting this to work by renaming variables so that we can refer to the store.set in the top-level scope.

@Conduitry
Copy link
Member

In 3.24.0, this is now a compiler error - https://svelte.dev/repl/8b351c8352044772a0561cc56a5f85a2?version=3.24.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants