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
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"orfalseor42are not of type{ option1?: boolean }.Actual behavior:
No type error is shown