Description
This had already been discussed here which was a different issue that was concluded to be intended behaviour, but that abstract methods allowing async
was not intended.
TypeScript Version: Version 3.2.0-dev.20181113
Search Terms:
abstract async, async
Code
// assuming `--lib es2015` is passed to the compiler
abstract class ShouldFailClass {
async abstract someMethod(): Promise<number>; // This should error, but doesn't
}
Expected behavior:
Abstract methods should not allow an async
modifier in the same way an interface and other type parameters don't allow them.
Actual behavior:
Abstract methods do not error with an async
modifier attached; interface methods do.
Playground Link: Both of these should error, not just the second on, as discussed in the earlier linked issue. Reproduced here
Related Issues:
Originally discussed in the comments in here, where the consensus was that the behavior was intended for that case, but that async abstract
should not be allowed.