TypeScript/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types

38 lines
3.2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts ===
function f<T>() {
2015-04-13 23:01:57 +02:00
>f : <T>() => <U extends T>(u: U) => U, Symbol(f, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0))
>T : T, Symbol(T, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 11))
2014-08-15 23:33:16 +02:00
function g<U extends T>(u: U): U { return null }
2015-04-13 23:01:57 +02:00
>g : <U extends T>(u: U) => U, Symbol(g, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 17))
>U : U, Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15))
>T : T, Symbol(T, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 11))
>u : U, Symbol(u, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 28))
>U : U, Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15))
>U : U, Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
return g;
2015-04-13 23:01:57 +02:00
>g : <U extends T>(u: U) => U, Symbol(g, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 17))
2014-08-15 23:33:16 +02:00
}
var h: <V, W>(v: V, func: (v: V) => W) => W;
2015-04-13 23:01:57 +02:00
>h : <V, W>(v: V, func: (v: V) => W) => W, Symbol(h, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3))
>V : V, Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8))
>W : W, Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10))
>v : V, Symbol(v, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 14))
>V : V, Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8))
>func : (v: V) => W, Symbol(func, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 19))
>v : V, Symbol(v, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 27))
>V : V, Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8))
>W : W, Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10))
>W : W, Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10))
2014-08-15 23:33:16 +02:00
var x = h("", f<string>()); // Call should succeed and x should be string. All type parameters should be instantiated to string
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 5, 3))
2014-08-15 23:33:16 +02:00
>h("", f<string>()) : string
2015-04-13 23:01:57 +02:00
>h : <V, W>(v: V, func: (v: V) => W) => W, Symbol(h, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3))
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
>f<string>() : <U extends string>(u: U) => U
2015-04-13 23:01:57 +02:00
>f : <T>() => <U extends T>(u: U) => U, Symbol(f, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0))
2014-08-15 23:33:16 +02:00