TypeScript/tests/baselines/reference/typeParameterAssignability.errors.txt
2014-07-12 17:30:19 -07:00

11 lines
450 B
Plaintext

==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts (2 errors) ====
// 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
~
!!! Type 'U' is not assignable to type 'T'.
u = t; // error
~
!!! Type 'T' is not assignable to type 'U'.
}