1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
tests/cases/conformance/types/primitives/enum/validEnumAssignments.ts(26,1): error TS2322: Type '-1' is not assignable to type 'E'.
==== tests/cases/conformance/types/primitives/enum/validEnumAssignments.ts (1 errors) ====
enum E {
A,
B
}
var n: number;
var a: any;
var e: E;
n = e;
n = E.A;
a = n;
a = e;
a = E.A;
e = e;
e = E.A;
e = E.B;
e = n;
e = null;
e = undefined;
e = 1;
e = 1.;
e = 1.0;
e = -1;
~
!!! error TS2322: Type '-1' is not assignable to type 'E'.
|