mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
14 lines
322 B
TypeScript
14 lines
322 B
TypeScript
//// [tests/cases/compiler/destructuringFromUnionSpread.ts] ////
|
|
|
|
//// [destructuringFromUnionSpread.ts]
|
|
interface A { a: string }
|
|
interface B { b: number }
|
|
|
|
declare const x: A | B;
|
|
const { a } = { ...x } // error
|
|
|
|
|
|
//// [destructuringFromUnionSpread.js]
|
|
"use strict";
|
|
const { a } = Object.assign({}, x); // error
|