google / google/closure-compiler
The return type of an async function must be a supertype of Promise
Open
internal-issue-created
triage-done
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
If a class extends another class where a certain function is sync, with an async function, there will be a warning.
```js
class B {
_transform() {
console.log('sorry not sorry')
}
}
class A extends B {
async _transform() {
console.log('good morning my neighbours')
}
}
class C {
async _transform() {
console.log('google closure compiler rules')
}
}
new A()._transform()
new C()._transform()
```
```sh
t/async.js:8: WARNING - The return type of an async function must be a supertype of Promise
found: undefined
async _transform() {
^^^^^^^^^^^^^^
```
Contributor guide
Assessment
This issue has not been assessed yet.