We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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: 2.2.1 / nightly (2.2.0-dev.201xxxxx) Try it yourself using this Playground Link
Code
function fancyMethod({ option1 = true }: { option1?: boolean } = {}) { console.log(option1); } fancyMethod("abc"); fancyMethod(false); fancyMethod(42);
Expected behavior:
Typescript will let me know that "abc" or false or 42 are not of type { option1?: boolean }.
"abc"
false
42
{ option1?: boolean }
Actual behavior:
No type error is shown
The text was updated successfully, but these errors were encountered:
Possible duplicate of #7485, and it was said that was fixed by #16047.
See #16247 (comment)
But it seems primitive types are still not considered a weak type.
EDIT: should fixed in #16343
Sorry, something went wrong.
Thanks for your feedback :)
Is there any way to find out the current playground version number? Is there a nightly playground?
You can see the version in the console.
But I think it will be v2.3.3+ based on #16131 (comment), so weird.
And selectable playground version is tracked by #15662.
EDIT: fix typo
No branches or pull requests
TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Try it yourself using this Playground Link
Code
Expected behavior:
Typescript will let me know that
"abc"
orfalse
or42
are not of type{ option1?: boolean }
.Actual behavior:
No type error is shown
The text was updated successfully, but these errors were encountered: