-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Labels
Milestone
Description
Describe the bug
In TSC, when you have an enum type, the base enum type is set as design:type.
SWC is setting the enum object itself.
Input code
enum MyEnum {
x = "xxx",
y = "yyy"
}
class Xpto {
@Decorator()
value!: MyEnum;
}
function Decorator() {
return function (...args) {};
}
Config
{
"module": {
"type": "commonjs"
},
"jsc": {
"target": "es2018",
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": false
},
"transform": {
"legacyDecorator": false,
"decoratorMetadata": true
}
}
}
Expected behavior
A clear and concise description of what you expected to happen.
TSC:
__decorate([
Decorator(),
__metadata("design:type", String)
], Xpto.prototype, "value", void 0);
SWC:
Reflect.metadata("design:type", typeof MyEnum === "undefined" ? Object : MyEnum)
Chayuan, Exilz, thomaschaaf, asztal, rohit-gohri and 3 more