Closed
Description
TypeScript Version: 3.9.7
Search Terms: async, codefix, decorator
Code
class Test {
@Deco()
test() {
return fetch('www.typescript.com').then(x => x);
}
}
function Deco() {
return (_target, _key, descriptor: PropertyDescriptor) => descriptor;
}
Expected behavior:
After i run the "Convert to async function" codefix, the expcted result is:
@Deco()
async test() {
const x = await fetch('www.typescript.com');
return x;
}
Or at least:
@Deco() async test() {
Actual behavior:
async @Deco() test() {
const x = await fetch('www.typescript.com');
return x;
}
Playground Link: Playground Link
Related Issues: