2014-07-13 01:04:16 +02:00
|
|
|
//// [grammarAmbiguities1.ts]
|
|
|
|
class A { foo() { } }
|
|
|
|
class B { bar() { }}
|
|
|
|
function f(x) { return x; }
|
|
|
|
function g<T, U>(x) { return f(x); }
|
|
|
|
g<A, B>(7)
|
|
|
|
|
|
|
|
f(g<A, B>(7));
|
|
|
|
f(g < A, B > 7);
|
|
|
|
f(g < A, B > +(7));
|
|
|
|
|
|
|
|
|
|
|
|
//// [grammarAmbiguities1.js]
|
|
|
|
var A = (function () {
|
|
|
|
function A() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
A.prototype.foo = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return A;
|
|
|
|
})();
|
|
|
|
var B = (function () {
|
|
|
|
function B() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
B.prototype.bar = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return B;
|
|
|
|
})();
|
2015-02-07 05:03:24 +01:00
|
|
|
function f(x) { return x; }
|
|
|
|
function g(x) { return f(x); }
|
2014-07-13 01:04:16 +02:00
|
|
|
g(7);
|
|
|
|
f(g(7));
|
|
|
|
f(g < A, B > 7);
|
|
|
|
f(g < A, B > +(7));
|