-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using a type cast (as X) inside a reactive assignment, the code is transformed wrongly and weird errors occur
To Reproduce
<script lang="ts">
type Team = any;
$: team = { search: "Real", players: [] } as Team;
</script>Expected behavior
This should be possible
System (please complete the following information):
language-server 0.14.1
Additional context
Possible fix: Add parantheses around it after transformation. This works:
<script lang="ts">
type Team = any;
$: team = ({ search: "Real", players: [] } as Team);
</script>But the parantheses are removed by prettier.
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working