2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts ===
|
|
|
|
declare function map<T, U>(array: T, func: (x: T) => U): U;
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
|
|
|
>T : T, Symbol(T,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,21))
|
|
|
|
>U : U, Symbol(U,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,23))
|
|
|
|
>array : T, Symbol(array,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,27))
|
|
|
|
>T : T, Symbol(T,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,21))
|
|
|
|
>func : (x: T) => U, Symbol(func,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,36))
|
|
|
|
>x : T, Symbol(x,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,44))
|
|
|
|
>T : T, Symbol(T,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,21))
|
|
|
|
>U : U, Symbol(U,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,23))
|
|
|
|
>U : U, Symbol(U,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,23))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
declare function identity<V>(y: V): V;
|
2015-04-13 22:54:22 +02:00
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
|
|
|
>V : V, Symbol(V,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,1,26))
|
|
|
|
>y : V, Symbol(y,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,1,29))
|
|
|
|
>V : V, Symbol(V,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,1,26))
|
|
|
|
>V : V, Symbol(V,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,1,26))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var s: string;
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// dotted name
|
|
|
|
var dottedIdentity = { x: identity };
|
2015-04-13 22:54:22 +02:00
|
|
|
>dottedIdentity : { x: <V>(y: V) => V; }, Symbol(dottedIdentity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,3))
|
2014-08-28 21:52:44 +02:00
|
|
|
>{ x: identity } : { x: <V>(y: V) => V; }
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : <V>(y: V) => V, Symbol(x,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,22))
|
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
s = map("", dottedIdentity.x);
|
|
|
|
>s = map("", dottedIdentity.x) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", dottedIdentity.x) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>dottedIdentity.x : <V>(y: V) => V, Symbol(x,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,22))
|
|
|
|
>dottedIdentity : { x: <V>(y: V) => V; }, Symbol(dottedIdentity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,3))
|
|
|
|
>x : <V>(y: V) => V, Symbol(x,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,22))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// index expression
|
|
|
|
s = map("", dottedIdentity['x']);
|
|
|
|
>s = map("", dottedIdentity['x']) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", dottedIdentity['x']) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>dottedIdentity['x'] : <V>(y: V) => V
|
2015-04-13 22:54:22 +02:00
|
|
|
>dottedIdentity : { x: <V>(y: V) => V; }, Symbol(dottedIdentity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,3))
|
|
|
|
>'x' : string, Symbol(x,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,5,22))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// function call
|
|
|
|
s = map("", (() => identity)());
|
|
|
|
>s = map("", (() => identity)()) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", (() => identity)()) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>(() => identity)() : <V>(y: V) => V
|
|
|
|
>(() => identity) : () => <V>(y: V) => V
|
|
|
|
>() => identity : () => <V>(y: V) => V
|
2015-04-13 22:54:22 +02:00
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// construct
|
|
|
|
interface IdentityConstructor {
|
2015-04-13 22:54:22 +02:00
|
|
|
>IdentityConstructor : IdentityConstructor, Symbol(IdentityConstructor,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,12,32))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new (): typeof identity;
|
2015-04-13 22:54:22 +02:00
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
var ic: IdentityConstructor;
|
2015-04-13 22:54:22 +02:00
|
|
|
>ic : IdentityConstructor, Symbol(ic,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,18,3))
|
|
|
|
>IdentityConstructor : IdentityConstructor, Symbol(IdentityConstructor,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,12,32))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
s = map("", new ic());
|
|
|
|
>s = map("", new ic()) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", new ic()) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>new ic() : <V>(y: V) => V
|
2015-04-13 22:54:22 +02:00
|
|
|
>ic : IdentityConstructor, Symbol(ic,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,18,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// assignment
|
|
|
|
var t;
|
2015-04-13 22:54:22 +02:00
|
|
|
>t : any, Symbol(t,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,22,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
s = map("", t = identity);
|
|
|
|
>s = map("", t = identity) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", t = identity) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>t = identity : <V>(y: V) => V
|
2015-04-13 22:54:22 +02:00
|
|
|
>t : any, Symbol(t,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,22,3))
|
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// type assertion
|
|
|
|
s = map("", <typeof identity>identity);
|
|
|
|
>s = map("", <typeof identity>identity) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", <typeof identity>identity) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
><typeof identity>identity : <V>(y: V) => V
|
2015-04-13 22:54:22 +02:00
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// parenthesized expression
|
|
|
|
s = map("", (identity));
|
|
|
|
>s = map("", (identity)) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", (identity)) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>(identity) : <V>(y: V) => V
|
2015-04-13 22:54:22 +02:00
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// comma
|
|
|
|
s = map("", ("", identity));
|
|
|
|
>s = map("", ("", identity)) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>s : string, Symbol(s,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,2,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>map("", ("", identity)) : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>map : <T, U>(array: T, func: (x: T) => U) => U, Symbol(map,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-28 21:52:44 +02:00
|
|
|
>("", identity) : <V>(y: V) => V
|
|
|
|
>"", identity : <V>(y: V) => V
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>identity : <V>(y: V) => V, Symbol(identity,Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts,0,59))
|
2014-08-15 23:33:16 +02:00
|
|
|
|