File: ambiguousGenericAssertion1.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 (30 lines) | stat: -rw-r--r-- 1,512 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
30
=== tests/cases/compiler/ambiguousGenericAssertion1.ts ===
function f<T>(x: T): T { return null; }
>f : Symbol(f, Decl(ambiguousGenericAssertion1.ts, 0, 0))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 0, 11))
>x : Symbol(x, Decl(ambiguousGenericAssertion1.ts, 0, 14))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 0, 11))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 0, 11))

var r = <T>(x: T) => x;
>r : Symbol(r, Decl(ambiguousGenericAssertion1.ts, 1, 3))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 1, 9))
>x : Symbol(x, Decl(ambiguousGenericAssertion1.ts, 1, 12))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 1, 9))
>x : Symbol(x, Decl(ambiguousGenericAssertion1.ts, 1, 12))

var r2 = < <T>(x: T) => T>f; // valid
>r2 : Symbol(r2, Decl(ambiguousGenericAssertion1.ts, 2, 3))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 2, 12))
>x : Symbol(x, Decl(ambiguousGenericAssertion1.ts, 2, 15))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 2, 12))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 2, 12))
>f : Symbol(f, Decl(ambiguousGenericAssertion1.ts, 0, 0))

var r3 = <<T>(x: T) => T>f; // ambiguous, appears to the parser as a << operation
>r3 : Symbol(r3, Decl(ambiguousGenericAssertion1.ts, 3, 3))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 3, 16))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 3, 16))
>T : Symbol(T, Decl(ambiguousGenericAssertion1.ts, 3, 16))
>f : Symbol(f, Decl(ambiguousGenericAssertion1.ts, 0, 0))