mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
1.5 KiB
Plaintext
33 lines
1.5 KiB
Plaintext
//// [tests/cases/compiler/ambiguousGenericAssertion1.ts] ////
|
|
|
|
=== 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))
|
|
|