mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
32 lines
412 B
TypeScript
32 lines
412 B
TypeScript
//// [tests/cases/compiler/destructionAssignmentError.ts] ////
|
|
|
|
//// [destructionAssignmentError.ts]
|
|
declare function fn(): { a: 1, b: 2 }
|
|
let a: number;
|
|
let b: number;
|
|
|
|
({ a, b } = fn());
|
|
{ a, b } = fn();
|
|
|
|
({ a, b } =
|
|
fn());
|
|
|
|
{ a, b }
|
|
= fn();
|
|
|
|
//// [destructionAssignmentError.js]
|
|
"use strict";
|
|
let a;
|
|
let b;
|
|
({ a, b } = fn());
|
|
{
|
|
a, b;
|
|
}
|
|
fn();
|
|
({ a, b } =
|
|
fn());
|
|
{
|
|
a, b;
|
|
}
|
|
fn();
|