16 lines
957 B
Plaintext
16 lines
957 B
Plaintext
tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern3.ts(3,6): error TS2322: Type 'string | number' is not assignable to type 'string'.
|
|
Type 'number' is not assignable to type 'string'.
|
|
tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern3.ts(3,9): error TS2322: Type 'string | number' is not assignable to type 'number'.
|
|
Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern3.ts (2 errors) ====
|
|
var a: string, b: number;
|
|
var tuple: [string, number] = ["", 1];
|
|
[...[a, b = 0]] = tuple;
|
|
~
|
|
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
~
|
|
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'. |