We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG
TypeScript Version:2.1.6
Code
//example (async()=>{ await 1; await ""; await new Date(); await []; await null; await undefined; })();
Expected behavior:Type error
Actual behavior:Successful compilation
The text was updated successfully, but these errors were encountered:
But that is OK. See the behavior of await as documented https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await Specifically MDN states that:
await
If the value is not a Promise, it converts the value to a resolved Promise, and waits for it.
Sorry, something went wrong.
Tslint has a rule for this. https://palantir.github.io/tslint/rules/await-promise/
Thank you. I am going to go turn that on.
Previously discussed at #8310 and #9921
I understand. Thank you.
No branches or pull requests
BUG
TypeScript Version:2.1.6
Code
Expected behavior:Type error
Actual behavior:Successful compilation
The text was updated successfully, but these errors were encountered: