TypeScript/tests/baselines/reference/typeParameterAssignability.js
2014-08-15 15:49:09 -07:00

15 lines
443 B
TypeScript

//// [typeParameterAssignability.ts]
// type parameters are not assignable to one another unless directly or indirectly constrained to one another
function foo<T, U>(t: T, u: U) {
t = u; // error
u = t; // error
}
//// [typeParameterAssignability.js]
// type parameters are not assignable to one another unless directly or indirectly constrained to one another
function foo(t, u) {
t = u; // error
u = t; // error
}