You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It sets that 'emitDecoratorMetadata' is true in the 'tsconfig.json'.
If the classes depend on one another, It will occur exception.
Code
functionTestReflect(){returnfunction(target: any,methodName?: string): any{}}classApple{// Need Banana
@TestReflect()publicSome(banana: Banana){}}
@TestReflect()classBanana{// Need Applepublicconstructor(apple: Apple){}}
Expected behavior:
functionTestReflect(){returnfunction(target,methodName){};}classApple{Some(banana){}}__decorate([TestReflect(),__metadata("design:type",Function),// __metadata("design:paramtypes", [Banana]),// i wish there is another new option to emit metadata like this// add a function '()=>Banana' into metadata__metadata("design:paramtypes:delay",[()=>Banana]),// or this// with more type informations__metadata("design:paramtypes:new",[{GenericTypeDefinition: ()=>Banana,GenericArguments: [()=>Number]}]),__metadata("design:returntype",void0)],Apple.prototype,"Some",null);letBanana=classBanana{constructor(apple){}};Banana=__decorate([TestReflect(),__metadata("design:paramtypes",[Apple])],Banana);
Actual behavior:
functionTestReflect(){returnfunction(target,methodName){};}classApple{Some(banana){}}__decorate([TestReflect(),__metadata("design:type",Function),// it will occur exception here.// Uncaught ReferenceError: Banana is not defined.__metadata("design:paramtypes",[Banana]),__metadata("design:returntype",void0)],Apple.prototype,"Some",null);letBanana=classBanana{constructor(apple){}};Banana=__decorate([TestReflect(),__metadata("design:paramtypes",[Apple])],Banana);
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered:
The meta-data emit, continues to be an experimental feature tied to decorators, and has a very limited scope (i.e. classes and primitives). we have no plans to expand that scope either.
TypeScript Version: 3.7.0-dev.20191009
Search Terms:
It sets that 'emitDecoratorMetadata' is true in the 'tsconfig.json'.
If the classes depend on one another, It will occur exception.
Code
Expected behavior:
Actual behavior:
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: