fix: ignore TypeScript generics on variables (#14509)

fixes #14505
pull/14513/head
Simon H 9 months ago committed by GitHub
parent aaea254102
commit b72fd2b3cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ignore TypeScript generics on variables

@ -104,6 +104,9 @@ const visitors = {
} }
return context.visit(node.parameter); return context.visit(node.parameter);
}, },
TSInstantiationExpression(node, context) {
return context.visit(node.expression);
},
FunctionExpression: remove_this_param, FunctionExpression: remove_this_param,
FunctionDeclaration: remove_this_param, FunctionDeclaration: remove_this_param,
TSDeclareFunction() { TSDeclareFunction() {

@ -8,7 +8,7 @@
console.log(this); console.log(this);
} }
class Foo { class Foo<T> {
public name: string; public name: string;
x = 'x' as const; x = 'x' as const;
constructor(name: string) { constructor(name: string) {
@ -32,6 +32,8 @@
export function overload(c: any): any {} export function overload(c: any): any {}
export type { Hello }; export type { Hello };
const TypedFoo = Foo<true>;
</script> </script>
<script> <script>

Loading…
Cancel
Save