mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
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:
committed by
GitHub
parent
58c54127a9
commit
db09cb5951
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user