Promise's then
method allows to get wrong type for term depends of its type-argument.
#43642
Labels
Duplicate
An existing issue was already created
Bug Report
π Search Terms
then, Promise, async
π Version & Regression Information
v 4.2.3
v 4.3.0-dev.20210412
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Output:
"number"
This is wrong because
x
annotated asPromise<number>
and it typechecks.π Expected behavior
Compilation error or output:
"object"
The text was updated successfully, but these errors were encountered: