swc/crates/swc_ecma_parser/tests/tsc/tsxGenericArrowFunctionParsing.tsx

32 lines
541 B
TypeScript

//@filename: file.tsx
//@jsx: preserve
declare module JSX {
interface Element { isElement; }
}
var T: any, T1: any, T2: any;
// This is an element
var x1 = <T>() => {}</T>;
x1.isElement;
// This is a generic function
var x2 = <T extends {}>() => {};
x2();
// This is a generic function
var x3 = <T, T1>() => {};
x3();
// This is an element
var x4 = <T extends={true}>() => {}</T>;
x4.isElement;
// This is an element
var x5 = <T extends>() => {}</T>;
x5.isElement;
// This is a generic function
var x6 = <T = string,>() => {};
x6();