Files
tsgo/testdata/baselines/reference/submodule/compiler/excessPropertyCheckWithSpread.js

26 lines
496 B
TypeScript

//// [tests/cases/compiler/excessPropertyCheckWithSpread.ts] ////
//// [excessPropertyCheckWithSpread.ts]
declare function f({ a: number }): void
interface I {
readonly n: number;
}
declare let i: I;
f({ a: 1, ...i });
interface R {
opt?: number
}
interface L {
opt: string
}
declare let l: L;
declare let r: R;
f({ a: 1, ...l, ...r });
//// [excessPropertyCheckWithSpread.js]
"use strict";
f(Object.assign({ a: 1 }, i));
f(Object.assign(Object.assign({ a: 1 }, l), r));