64ff195426
* Set-only accessors spread to undefined Previously they were skipped. The runtime behaviour is to create a property of type undefined, unlike (for example) spreading numbers or other primitives. So now spreading a set-only accessor creates a property of type undefined: ```ts const o: { foo: undefined } = { ...{ set foo(v: number) { } } } ``` Notably, `o.foo: undefined` not `number`. Fixes #26337 * Fix isSpreadableProperty oversimplification
4 lines
199 B
TypeScript
4 lines
199 B
TypeScript
// @strict: true
|
|
// @target: esnext
|
|
const o1: { foo: number, bar: undefined } = { foo: 1, ... { set bar(_v: number) { } } }
|
|
const o2: { foo: undefined } = { foo: 1, ... { set foo(_v: number) { } } }
|