mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
19 lines
699 B
Plaintext
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'.
|
|
}
|
|
|