typeRelatedToSomeType passes through intersectionState (#43707)

* typeRelatedToSomeType passes through intersectionState

Previously it didn't, even though it should have.

* fix parameter name lint
This commit is contained in:
Nathan Shively-Sanders
2021-04-28 16:12:20 -07:00
committed by GitHub
parent 58c54127a9
commit db09cb5951
5 changed files with 236 additions and 6 deletions

View File

@@ -13,3 +13,37 @@ function getMaxId(items: NodeWithId[]) {
const nodes = [] as ITreeItem[];
getMaxId(nodes);
// Repro from #42715
export interface Donkey {
donkey: string;
}
interface Diddy {
diddy: string;
children?: Diddy[] | Donkey;
}
interface Cranky {
cranky: string;
children: Diddy;
}
type Dandy = Diddy & {
children: (Diddy & { funky?: string })[];
};
type X = Dandy["children"]
var x: X
const mainView: Dandy = {
diddy: "",
children: [
{
diddy: "",
funky: "Empty" // <- Incorrect error
}
],
};
// Legal
const p = mainView.children[0].funky