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
TypeScript Version: 3.7.x-dev.20200220
Search Terms: Implicit type coersion function ternary
Code
function isSomething(): boolean { return false } const haha = isSomething ? 'a' : 'b';
Expected behavior: Typescript should throw error in = isSomething ? instead of coercing isSomething to boolean
= isSomething ?
isSomething
Actual behavior: Typescript coerced isSomething (function) to boolean
Playground Link: link
Related Issues:
The text was updated successfully, but these errors were encountered:
Fixed in #36402 (will be in 3.9)
Sorry, something went wrong.
Omg thanks a lot @IllusionMH! Apologies for this duplicate issue.
No branches or pull requests
TypeScript Version: 3.7.x-dev.20200220
Search Terms: Implicit type coersion function ternary
Code
Expected behavior: Typescript should throw error in
= isSomething ?
instead of coercingisSomething
to booleanActual behavior: Typescript coerced
isSomething
(function) to booleanPlayground Link: link
Related Issues:
The text was updated successfully, but these errors were encountered: