Hey TS - Heroes :-)
I've got a small question. Is the async keyword intended to set the correct return type when using decorators? I'd expect such a thing:
classFoo{
@AnyDecorator()publicasyncfoobar(){}}this should decorate the function foobar with the return type Promise.
Actually it produces:
classFoo{foobar(){return__awaiter(this,void0,void0,function*(){});}}__decorate([AnyDecorator(),__metadata('design:type',Function),__metadata('design:paramtypes',[]),__metadata('design:returntype',void0)],Foo.prototype,"foobar",null);I'd expect the return type to be Promise like:
classFoo{foobar(){return__awaiter(this,void0,Promise,function*(){});}}__decorate([AnyDecorator(),__metadata('design:type',Function),__metadata('design:paramtypes',[]),__metadata('design:returntype',Promise)],Foo.prototype,"foobar",null);Cheers
Chris
Hey TS - Heroes :-)
I've got a small question. Is the
asynckeyword intended to set the correct return type when using decorators? I'd expect such a thing:this should decorate the function foobar with the return type
Promise.Actually it produces:
I'd expect the return type to be
Promiselike:Cheers
Chris