-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
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 }
.
Actual behavior:
No type error is shown
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created