* Always generate type & symbol baselines * Accept changed shadowed baselines * Accept brand new type and symbol baselines * Allow `getTypeAtLocation` to return undefined in the type writer * Accept baselines which had missing type information * Bind container for dynamically names enum members so they may be printed * Accept type/symbol baselines for enums with computed members * First pass at reducing typeWriter memory overhead * Use generators to allow for type and symbol baselines with no cache * Accept new baselines for tests whose output was fixed by better newline splitting * Hard cap on number of declarations printed, cache declaration print text * handle differing newlines better still to handle RWC newlines * Lower abridging count, accept abridged baselines * Limit max RWC error output size, limit RWC type and symbol baseline input size * Move skip logic into type and symbol baseliner to streamline error handling * Accept removal of empty baselines * Canonicalize path earlier to handle odd paths in input files * Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another * No need to pathify again
105 lines
1.4 KiB
Plaintext
105 lines
1.4 KiB
Plaintext
=== tests/cases/conformance/enums/enumErrors.ts ===
|
|
// Enum named with PredefinedTypes
|
|
enum any { }
|
|
>any : any
|
|
|
|
enum number { }
|
|
>number : number
|
|
|
|
enum string { }
|
|
>string : string
|
|
|
|
enum boolean { }
|
|
>boolean : boolean
|
|
|
|
// Enum with computed member initializer of type Number
|
|
enum E5 {
|
|
>E5 : E5
|
|
|
|
C = new Number(30)
|
|
>C : E5
|
|
>new Number(30) : Number
|
|
>Number : NumberConstructor
|
|
>30 : 30
|
|
}
|
|
|
|
enum E9 {
|
|
>E9 : E9
|
|
|
|
A,
|
|
>A : E9
|
|
|
|
B = A
|
|
>B : E9
|
|
>A : E9
|
|
}
|
|
|
|
//Enum with computed member intializer of different enum type
|
|
// Bug 707850: This should be allowed
|
|
enum E10 {
|
|
>E10 : E10
|
|
|
|
A = E9.A,
|
|
>A : E10
|
|
>E9.A : E9
|
|
>E9 : typeof E9
|
|
>A : E9
|
|
|
|
B = E9.B
|
|
>B : E10
|
|
>E9.B : E9
|
|
>E9 : typeof E9
|
|
>B : E9
|
|
}
|
|
|
|
// Enum with computed member intializer of other types
|
|
enum E11 {
|
|
>E11 : E11
|
|
|
|
A = true,
|
|
>A : E11
|
|
>true : true
|
|
|
|
B = new Date(),
|
|
>B : E11
|
|
>new Date() : Date
|
|
>Date : DateConstructor
|
|
|
|
C = window,
|
|
>C : E11
|
|
>window : any
|
|
|
|
D = {}
|
|
>D : E11
|
|
>{} : {}
|
|
}
|
|
|
|
// Enum with string valued member and computed member initializers
|
|
enum E12 {
|
|
>E12 : E12
|
|
|
|
A = '',
|
|
>A : E12.A
|
|
>'' : ""
|
|
|
|
B = new Date(),
|
|
>B : E12.B
|
|
>new Date() : Date
|
|
>Date : DateConstructor
|
|
|
|
C = window,
|
|
>C : E12.B
|
|
>window : any
|
|
|
|
D = {},
|
|
>D : E12.B
|
|
>{} : {}
|
|
|
|
E = 1 + 1,
|
|
>E : E12.B
|
|
>1 + 1 : number
|
|
>1 : 1
|
|
>1 : 1
|
|
}
|
|
|