TypeScript/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types
Jason Freeman 8bb956eb91 More tests
2015-07-09 14:41:08 -07:00

24 lines
684 B
Plaintext

=== tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression1.ts ===
function foo<T>(x = class { static prop: T }): T {
>foo : <T>(x?: typeof (Anonymous class)) => T
>T : T
>x : typeof (Anonymous class)
>class { static prop: T } : typeof (Anonymous class)
>prop : T
>T : T
>T : T
return undefined;
>undefined : undefined
}
foo(class { static prop = "hello" }).length;
>foo(class { static prop = "hello" }).length : number
>foo(class { static prop = "hello" }) : string
>foo : <T>(x?: typeof (Anonymous class)) => T
>class { static prop = "hello" } : typeof (Anonymous class)
>prop : string
>"hello" : string
>length : number