1 2 3 4 5 6 7 8 9 10 11
|
tests/cases/compiler/objectLiteralFreshnessWithSpread.ts(2,35): error TS2322: Type '{ z: number; b: number; extra: number; a: number; }' is not assignable to type '{ a: any; b: any; }'.
Object literal may only specify known properties, and 'z' does not exist in type '{ a: any; b: any; }'.
==== tests/cases/compiler/objectLiteralFreshnessWithSpread.ts (1 errors) ====
let x = { b: 1, extra: 2 }
let xx: { a, b } = { a: 1, ...x, z: 3 } // error for 'z', no error for 'extra'
~~~~
!!! error TS2322: Type '{ z: number; b: number; extra: number; a: number; }' is not assignable to type '{ a: any; b: any; }'.
!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ a: any; b: any; }'.
|