TypeScript/tests/baselines/reference/restElementWithAssignmentPattern2.errors.txt

13 lines
850 B
Plaintext

tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts(2,10): error TS2322: Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts(2,18): error TS2459: Type '(string | number)[]' has no property 'b' and no string index signature.
==== tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts (2 errors) ====
var a: string, b: number;
[...{ 0: a = "", b }] = ["", 1];
~
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
~
!!! error TS2459: Type '(string | number)[]' has no property 'b' and no string index signature.