File: typeAssertionToGenericFunctionType.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 (29 lines) | stat: -rw-r--r-- 1,536 bytes parent folder | download | duplicates (5)
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
=== tests/cases/compiler/typeAssertionToGenericFunctionType.ts ===
var x = {
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 0, 3))

    a: < <T>(x: T) => T > ((x: any) => 1),
>a : Symbol(a, Decl(typeAssertionToGenericFunctionType.ts, 0, 9))
>T : Symbol(T, Decl(typeAssertionToGenericFunctionType.ts, 1, 10))
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 1, 13))
>T : Symbol(T, Decl(typeAssertionToGenericFunctionType.ts, 1, 10))
>T : Symbol(T, Decl(typeAssertionToGenericFunctionType.ts, 1, 10))
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 1, 28))

    b: <T>(x: T) => { x }
>b : Symbol(b, Decl(typeAssertionToGenericFunctionType.ts, 1, 42))
>T : Symbol(T, Decl(typeAssertionToGenericFunctionType.ts, 2, 8))
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 2, 11))
>T : Symbol(T, Decl(typeAssertionToGenericFunctionType.ts, 2, 8))
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 2, 11))
}
x.a<string>(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition
>x.a : Symbol(a, Decl(typeAssertionToGenericFunctionType.ts, 0, 9))
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 0, 3))
>a : Symbol(a, Decl(typeAssertionToGenericFunctionType.ts, 0, 9))

x.b<string>(); // error
>x.b : Symbol(b, Decl(typeAssertionToGenericFunctionType.ts, 1, 42))
>x : Symbol(x, Decl(typeAssertionToGenericFunctionType.ts, 0, 3))
>b : Symbol(b, Decl(typeAssertionToGenericFunctionType.ts, 1, 42))