You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When an each block follows a slot that uses a let directive that hides a variable of the same name in the parent then the each block incorrectly references the value from inside the slot.
The first line a a shows that the initial value of the array is ['a'].
The second line b shows that the value of the array inside the slot is ['b'].
The last line a b is unexpected. It shows that the value of the array is still ['a'] yet the each block is referencing the array from the slot, ['b'].
Expected behavior
I would expect either the each block to use the parents value or for the svelte compiler to warn about let directive variable already being defined.
The text was updated successfully, but these errors were encountered:
Describe the bug
When an each block follows a slot that uses a let directive that hides a variable of the same name in the parent then the each block incorrectly references the value from inside the slot.
To Reproduce
https://svelte.dev/repl/537557d31921471e97632c6780c0ea39?version=3.15.0
The first line
a a
shows that the initial value of the array is['a']
.The second line
b
shows that the value of the array inside the slot is['b']
.The last line
a b
is unexpected. It shows that the value of the array is still['a']
yet the each block is referencing the array from the slot,['b']
.Expected behavior
I would expect either the each block to use the parents value or for the svelte compiler to warn about let directive variable already being defined.
The text was updated successfully, but these errors were encountered: