* 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
58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
=== tests/cases/conformance/constEnums/constEnum2.ts ===
|
|
// An enum declaration that specifies a const modifier is a constant enum declaration.
|
|
// In a constant enum declaration, all members must have constant values and
|
|
// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression.
|
|
|
|
// Error : not a constant enum expression
|
|
|
|
const CONST = 9000 % 2;
|
|
>CONST : number
|
|
>9000 % 2 : number
|
|
>9000 : 9000
|
|
>2 : 2
|
|
|
|
const enum D {
|
|
>D : D
|
|
|
|
d = 10,
|
|
>d : D
|
|
>10 : 10
|
|
|
|
e = 199 * Math.floor(Math.random() * 1000),
|
|
>e : D
|
|
>199 * Math.floor(Math.random() * 1000) : number
|
|
>199 : 199
|
|
>Math.floor(Math.random() * 1000) : number
|
|
>Math.floor : (x: number) => number
|
|
>Math : Math
|
|
>floor : (x: number) => number
|
|
>Math.random() * 1000 : number
|
|
>Math.random() : number
|
|
>Math.random : () => number
|
|
>Math : Math
|
|
>random : () => number
|
|
>1000 : 1000
|
|
|
|
f = d - (100 * Math.floor(Math.random() % 8))
|
|
>f : D
|
|
>d - (100 * Math.floor(Math.random() % 8)) : number
|
|
>d : D
|
|
>(100 * Math.floor(Math.random() % 8)) : number
|
|
>100 * Math.floor(Math.random() % 8) : number
|
|
>100 : 100
|
|
>Math.floor(Math.random() % 8) : number
|
|
>Math.floor : (x: number) => number
|
|
>Math : Math
|
|
>floor : (x: number) => number
|
|
>Math.random() % 8 : number
|
|
>Math.random() : number
|
|
>Math.random : () => number
|
|
>Math : Math
|
|
>random : () => number
|
|
>8 : 8
|
|
|
|
g = CONST,
|
|
>g : D
|
|
>CONST : number
|
|
}
|