TypeScript/tests/baselines/reference/destructuringFromUnionSpread.errors.txt
Andrew Branch bd7d0f26b2
Don’t allow an object literal with a spread as a fallback for destructuring a property not present in all constituents (#43783)
* Add test

* Don’t allow an object literal with a spread as a fallback for destructuring a property not present in all constituents
2021-04-23 14:44:57 -07:00

12 lines
527 B
Plaintext

tests/cases/compiler/destructuringFromUnionSpread.ts(5,9): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
==== tests/cases/compiler/destructuringFromUnionSpread.ts (1 errors) ====
interface A { a: string }
interface B { b: number }
declare const x: A | B;
const { a } = { ...x } // error
~
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.