13 lines
314 B
JavaScript
13 lines
314 B
JavaScript
//// [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]
|
|
function foo(t, u) {
|
|
t = u;
|
|
u = t;
|
|
}
|