Files
tsgo/testdata/baselines/reference/submodule/conformance/enumErrorOnConstantBindingWithInitializer.errors.txt
2025-03-30 00:05:12 +00:00

19 lines
699 B
Plaintext

enumErrorOnConstantBindingWithInitializer.ts(9,10): error TS18033: Type 'string | number' is not assignable to type 'number' as required for computed enum member values.
Type 'string' is not assignable to type 'number'.
==== enumErrorOnConstantBindingWithInitializer.ts (1 errors) ====
type Thing = {
value?: string | number;
};
declare const thing: Thing;
const { value = "123" } = thing;
enum E {
test = value,
~~~~~
!!! error TS18033: Type 'string | number' is not assignable to type 'number' as required for computed enum member values.
!!! error TS18033: Type 'string' is not assignable to type 'number'.
}