TypeScript/tests/cases/compiler/recursiveExcessPropertyChecks.ts
Anders Hejlsberg 41a80f5d92
No infinite recursion in excess property and weak type checks (#37360)
* New IntersectionState.ExcessCheck flag to ensure no infinite recursion

* Add regression test
2020-03-12 09:40:15 -07:00

16 lines
243 B
TypeScript

// @strict: true
// Repro from #35804
interface ITreeItem {
Parent?: this;
}
type NodeWithId = ITreeItem & { Id?: number };
function getMaxId(items: NodeWithId[]) {
}
const nodes = [] as ITreeItem[];
getMaxId(nodes);