23 lines
684 B
Text
23 lines
684 B
Text
=== 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
|
|
|