41 lines
606 B
Text
41 lines
606 B
Text
=== tests/cases/compiler/typeArgumentInferenceOrdering.ts ===
|
|
function foo<T>(f: { y: T }): T { return null }
|
|
>foo : <T>(f: { y: T; }) => T
|
|
>T : T
|
|
>f : { y: T; }
|
|
>y : T
|
|
>T : T
|
|
>T : T
|
|
|
|
var x = foo(new C()).x; // was Error that property x does not exist on type {}
|
|
>x : () => Goo
|
|
>foo(new C()).x : () => Goo
|
|
>foo(new C()) : I
|
|
>foo : <T>(f: { y: T; }) => T
|
|
>new C() : C
|
|
>C : typeof C
|
|
>x : () => Goo
|
|
|
|
class C {
|
|
>C : C
|
|
|
|
y: I;
|
|
>y : I
|
|
>I : I
|
|
}
|
|
|
|
interface I {
|
|
>I : I
|
|
|
|
x(): Goo;
|
|
>x : () => Goo
|
|
>Goo : Goo
|
|
}
|
|
|
|
interface Goo {
|
|
>Goo : Goo
|
|
|
|
p: string;
|
|
>p : string
|
|
}
|
|
|