TypeScript/tests/baselines/reference/enumErrors.errors.txt

61 lines
2.2 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/enums/enumErrors.ts(2,6): error TS2431: Enum name cannot be 'any'
tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot be 'number'
tests/cases/conformance/enums/enumErrors.ts(4,6): error TS2431: Enum name cannot be 'string'
tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot be 'boolean'
2014-11-05 21:26:03 +01:00
tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'.
tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'string' is not assignable to type 'E11'.
tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'.
tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'.
==== tests/cases/conformance/enums/enumErrors.ts (9 errors) ====
2014-07-13 01:04:16 +02:00
// Enum named with PredefinedTypes
enum any { }
~~~
!!! error TS2431: Enum name cannot be 'any'
2014-07-13 01:04:16 +02:00
enum number { }
~~~~~~
!!! error TS2431: Enum name cannot be 'number'
2014-07-13 01:04:16 +02:00
enum string { }
~~~~~~
!!! error TS2431: Enum name cannot be 'string'
2014-07-13 01:04:16 +02:00
enum boolean { }
~~~~~~~
!!! error TS2431: Enum name cannot be 'boolean'
2014-07-13 01:04:16 +02:00
// Enum with computed member initializer of type Number
enum E5 {
C = new Number(30)
~~~~~~~~~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'Number' is not assignable to type 'E5'.
2014-07-13 01:04:16 +02:00
}
enum E9 {
A,
B = A
}
//Enum with computed member intializer of different enum type
// Bug 707850: This should be allowed
enum E10 {
A = E9.A,
B = E9.B
}
// Enum with computed member intializer of other types
enum E11 {
A = '',
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'E11'.
2014-07-13 01:04:16 +02:00
B = new Date(),
~~~~~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'Date' is not assignable to type 'E11'.
2014-07-13 01:04:16 +02:00
C = window,
~~~~~~
!!! error TS2304: Cannot find name 'window'.
2014-07-13 01:04:16 +02:00
D = {}
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type '{}' is not assignable to type 'E11'.
2014-07-13 01:04:16 +02:00
}