-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
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:
class Foo {
@AnyDecorator()
public async foobar() {
}
}
this should decorate the function foobar with the return type Promise
.
Actually it produces:
class Foo {
foobar() {
return __awaiter(this, void 0, void 0, function* () {
});
}
}
__decorate([
AnyDecorator(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], Foo.prototype, "foobar", null);
I'd expect the return type to be Promise
like:
class Foo {
foobar() {
return __awaiter(this, void 0, Promise, function* () {
});
}
}
__decorate([
AnyDecorator(),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', Promise)
], Foo.prototype, "foobar", null);
Cheers
Chris
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue