Looking at the tests for this aspect of this feature, I suspect it was intended only to work with let: variables from the component. If that's so, the docs should be made a bit clearer and the compiler should throw an exception rather than ignoring the {@const}.
Describe the bug
The docs state that
but currently if you use it inside a component slot the compiler fails to emit the assignment and the code throws at runtime.
If this is not the intended usage of
@const
(I hope it is though) the compiler should produce an error, otherwise it should emit the assignment.Reproduction
https://svelte.dev/repl/d01b574992e04be294ba081cddbf6859?version=3.46.2
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: