TypeScript/tests/baselines/reference/invalidEnumAssignments.errors.txt
2014-11-05 12:26:03 -08:00

43 lines
1.6 KiB
Plaintext

tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2' is not assignable to type 'E'.
tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E' is not assignable to type 'E2'.
tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2322: Type 'void' is not assignable to type 'E'.
tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2322: Type '{}' is not assignable to type 'E'.
tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type 'string' is not assignable to type 'E'.
tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2322: Type 'T' is not assignable to type 'E'.
==== 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;
~
!!! error TS2322: Type 'E2' is not assignable to type 'E'.
e2 = E.A;
~~
!!! error TS2322: Type 'E' is not assignable to type 'E2'.
e = <void>null;
~
!!! error TS2322: Type 'void' is not assignable to type 'E'.
e = {};
~
!!! error TS2322: Type '{}' is not assignable to type 'E'.
e = '';
~
!!! error TS2322: Type 'string' is not assignable to type 'E'.
function f<T>(a: T) {
e = a;
~
!!! error TS2322: Type 'T' is not assignable to type 'E'.
}