File: genericCallWithFunctionTypedArguments3.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (54 lines) | stat: -rw-r--r-- 2,501 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.ts ===
// No inference is made from function typed arguments which have multiple call signatures

var a: {
>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments3.ts, 2, 3))

    (x: boolean): boolean;
>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 3, 5))

    (x: string): any;
>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 4, 5))
}

function foo4<T, U>(cb: (x: T) => U) {
>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1))
>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 14))
>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16))
>cb : Symbol(cb, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 20))
>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 25))
>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 14))
>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16))

    var u: U;
>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments3.ts, 8, 7))
>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16))

    return u;
>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments3.ts, 8, 7))
}

var r = foo4(a); // T is {} (candidates boolean and string), U is any (candidates any and boolean)
>r : Symbol(r, Decl(genericCallWithFunctionTypedArguments3.ts, 12, 3))
>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1))
>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments3.ts, 2, 3))

var b: {
>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments3.ts, 14, 3))

    <T>(x: boolean): T;
>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 5))
>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 8))
>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 5))

    <T>(x: T): any;
>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 5))
>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 8))
>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 5))
}

var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {})
>r2 : Symbol(r2, Decl(genericCallWithFunctionTypedArguments3.ts, 19, 3))
>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1))
>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments3.ts, 14, 3))