TypeScript Version: 2.4.1
Code
function test(n: number,
{
method = 'z'
}: {
method?: 'x' | 'y',
} = {
method: 'y'
})
{
console.log('test', n, method);
}
test(1);
test(2, {});
Expected behavior:
Compile error: z is not a possible value for method's type.
Actual behavior:
Prints:
test 1 y
test 2 z
TypeScript Version: 2.4.1
Code
Expected behavior:
Compile error:
zis not a possible value formethod's type.Actual behavior:
Prints:
test 1 y
test 2 z