TypeScript/tests/cases/compiler/excessPropertyCheckWithNestedArrayIntersection.ts
Nathan Shively-Sanders 480b73915f
Improve excess property checking for intersections (#32582)
* Improve excess property checking for intersections

Still a draft, the implementation needs improvement

* Use mutable isIntersection in checkTypeRelatedTo

This makes parameter lists a lot shorter. Seems like a slight
improvement, although I can revert if I change my mind.

* Fix semicolon lint

* Remove TODOOOO

* Revert "Use mutable isIntersection in checkTypeRelatedTo"

This reverts commit b8dccff2a2.
2019-08-06 15:03:24 -07:00

23 lines
412 B
TypeScript

interface ValueOnlyFields {
fields: Array<{
value: number | null;
}>;
}
interface ValueAndKeyFields {
fields: Array<{
key: string | null;
value: number | null;
}>;
}
interface BugRepro {
dataType: ValueAndKeyFields & ValueOnlyFields;
}
const repro: BugRepro = {
dataType: {
fields: [{
key: 'bla', // should be OK: Not excess
value: null,
}],
}
}