mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 06:05:02 +03:00
14 lines
383 B
TypeScript
14 lines
383 B
TypeScript
// without strict null checks, none of these should be an error
|
|
declare var ab: { a: number, b: number };
|
|
declare var abq: { a: number, b?: number };
|
|
var unused1 = { b: 1, ...ab }
|
|
var unused2 = { ...ab, ...ab }
|
|
var unused3 = { b: 1, ...abq }
|
|
|
|
function g(obj: { x: number | undefined }) {
|
|
return { x: 1, ...obj };
|
|
}
|
|
function h(obj: { x: number }) {
|
|
return { x: 1, ...obj };
|
|
}
|