2014-07-13 01:04:16 +02:00
|
|
|
//// [typeParameterAssignmentCompat1.ts]
|
|
|
|
interface Foo<T> {
|
|
|
|
frobble(value: T): T;
|
|
|
|
}
|
|
|
|
|
|
|
|
function f<T, U>(): Foo<U> {
|
|
|
|
var x: Foo<T>;
|
|
|
|
var y: Foo<U>;
|
|
|
|
x = y; // should be an error
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
class C<T> {
|
|
|
|
f<U>(): Foo<U> {
|
|
|
|
var x: Foo<T>;
|
|
|
|
var y: Foo<U>;
|
|
|
|
x = y; // should be an error
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [typeParameterAssignmentCompat1.js]
|
|
|
|
function f() {
|
|
|
|
var x;
|
|
|
|
var y;
|
2014-08-16 00:49:09 +02:00
|
|
|
x = y; // should be an error
|
2014-07-13 01:04:16 +02:00
|
|
|
return x;
|
|
|
|
}
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
|
|
|
C.prototype.f = function () {
|
|
|
|
var x;
|
|
|
|
var y;
|
2014-08-16 00:49:09 +02:00
|
|
|
x = y; // should be an error
|
2014-07-13 01:04:16 +02:00
|
|
|
return x;
|
|
|
|
};
|
|
|
|
return C;
|
|
|
|
})();
|