2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
|
|
|
tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'.
|
2014-09-12 22:35:07 +02:00
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/typeParametersShouldNotBeEqual.ts (2 errors) ====
|
|
|
|
function ff<T, U>(x: T, y: U) {
|
|
|
|
var z: Object;
|
|
|
|
x = x; // Ok
|
|
|
|
x = y; // Error
|
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
2014-07-13 01:04:16 +02:00
|
|
|
x = z; // Error
|
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
2014-07-13 01:04:16 +02:00
|
|
|
z = x; // Ok
|
|
|
|
}
|
|
|
|
|