2015-02-03 00:30:33 +01:00
|
|
|
//// [ambiguousGenericAssertion1.ts]
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
//// [ambiguousGenericAssertion1.js]
|
2015-02-07 05:03:24 +01:00
|
|
|
function f(x) { return null; }
|
2015-02-03 00:30:33 +01:00
|
|
|
var r = function (x) { return x; };
|
|
|
|
var r2 = f; // valid
|
|
|
|
var r3 = << T > (x), T;
|
|
|
|
T > f; // ambiguous, appears to the parser as a << operation
|