File: objectLiteralFreshnessWithSpread.errors.txt

package info (click to toggle)
node-typescript 5.1.6%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 492,516 kB
  • sloc: javascript: 2,078,951; makefile: 6; sh: 1
file content (11 lines) | stat: -rw-r--r-- 791 bytes parent folder | download
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; }'.