-
-
Notifications
You must be signed in to change notification settings - Fork 210
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't workingupstream
Description
Describe the bug
Using the new generics notation introduced in #2020, you cannot use records the generics attribute because the generics
attribute is parsed as an HTML string, not as TypeScript code.
Reproduction
<script lang='ts' generics='T extends { foo: string }'>
</script>
Gives the error:
Error: Expected } (svelte)
<script lang="ts" generics="T extends { key: string }">
Expected behaviour
This entire string is parsed as JS and not as a string with interpolation.
System Info
- OS: macOS 13.3.1
- IDE: VS Code
- Svelte Check: 3.4.3
Which package is the issue about?
svelte-check
Additional Information, eg. Screenshots
There is a workaround, but I don't think this is ideal.
<script lang='ts' context='module'>
type Foo = { foo: string }
</script>
<script lang='ts' generics='T extends Foo'>
</script>
wvhulle, wildcant, fedorovvvv, kyrregjerstad, michaelhthomas and 1 more
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't workingupstream