mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
496 B
TypeScript
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));
|