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

35 lines
692 B
Plaintext

==== tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts (6 errors) ====
enum E {
A,
B
}
enum E2 {
A,
B
}
var e: E;
var e2: E2;
e = E2.A;
~
!!! Type 'E2' is not assignable to type 'E'.
e2 = E.A;
~~
!!! Type 'E' is not assignable to type 'E2'.
e = <void>null;
~
!!! Type 'void' is not assignable to type 'E'.
e = {};
~
!!! Type '{}' is not assignable to type 'E'.
e = '';
~
!!! Type 'string' is not assignable to type 'E'.
function f<T>(a: T) {
e = a;
~
!!! Type 'T' is not assignable to type 'E'.
}