* Error if assignment after block * Update src/compiler/diagnosticMessages.json Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> * Fix diags * Error after block Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
27 lines
1.7 KiB
Plaintext
27 lines
1.7 KiB
Plaintext
tests/cases/compiler/destructionAssignmentError.ts(6,3): error TS2695: Left side of comma operator is unused and has no side effects.
|
|
tests/cases/compiler/destructionAssignmentError.ts(6,10): error TS2809: Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses.
|
|
tests/cases/compiler/destructionAssignmentError.ts(11,3): error TS2695: Left side of comma operator is unused and has no side effects.
|
|
tests/cases/compiler/destructionAssignmentError.ts(12,1): error TS2809: Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses.
|
|
|
|
|
|
==== tests/cases/compiler/destructionAssignmentError.ts (4 errors) ====
|
|
declare function fn(): { a: 1, b: 2 }
|
|
let a: number;
|
|
let b: number;
|
|
|
|
({ a, b } = fn());
|
|
{ a, b } = fn();
|
|
~
|
|
!!! error TS2695: Left side of comma operator is unused and has no side effects.
|
|
~
|
|
!!! error TS2809: Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses.
|
|
|
|
({ a, b } =
|
|
fn());
|
|
|
|
{ a, b }
|
|
~
|
|
!!! error TS2695: Left side of comma operator is unused and has no side effects.
|
|
= fn();
|
|
~
|
|
!!! error TS2809: Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses. |