mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
27 lines
387 B
JavaScript
27 lines
387 B
JavaScript
// explicit type annotation should cause `method` to have type 'x' | 'y'
|
|
// both inside and outside `test`.
|
|
function test({ method ='z' , nested: { p ='c' } }) {
|
|
method;
|
|
p;
|
|
}
|
|
test({
|
|
});
|
|
test({
|
|
method: 'x',
|
|
nested: {
|
|
p: 'a'
|
|
}
|
|
});
|
|
test({
|
|
method: 'z',
|
|
nested: {
|
|
p: 'b'
|
|
}
|
|
});
|
|
test({
|
|
method: 'one',
|
|
nested: {
|
|
p: 'a'
|
|
}
|
|
});
|