16 lines
574 B
Plaintext
16 lines
574 B
Plaintext
==== tests/cases/compiler/ambiguousGenericAssertion1.ts (5 errors) ====
|
|
function f<T>(x: T): T { return null; }
|
|
var r = <T>(x: T) => x;
|
|
var r2 = < <T>(x: T) => T>f; // valid
|
|
var r3 = <<T>(x: T) => T>f; // ambiguous, appears to the parser as a << operation
|
|
~~
|
|
!!! error TS1109: Expression expected.
|
|
~
|
|
!!! error TS1005: ')' expected.
|
|
~
|
|
!!! error TS1005: ',' expected.
|
|
~~
|
|
!!! error TS1005: ';' expected.
|
|
~
|
|
!!! error TS2304: Cannot find name 'x'.
|
|
|