-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Typescript enum value with as syntax cause swc crash #11761
Copy link
Copy link
Open
Labels
Description
Describe the bug
Just as the playground shows:
It seems typescript can work for the case:
Input code
export enum RefType {
property = '11' as any,
event = '22' as any,
}
console.log(RefType.property, RefType.event);Config
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false
},
"target": "es2015",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6"
},
"minify": true,
"isModule": true
}Link to the code that reproduces this issue
SWC Info output
No response
Expected behavior
work normal as typescript.
Actual behavior
it will get crash
Version
1.15.21
Additional context
No response
Reactions are currently unavailable