Suggestion
π Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
β
Viability Checklist
My suggestion meets these guidelines:
β Suggestion
when we use satisfies keywords, infer empty array to typed array by satisfies target array instead of never array
π Motivating Example
interface TreeNode {
children: TreeNode[];
}
const a = {
children: [],
} satisfies TreeNode;
// expect: TreeNode[]
// accept: never[]
a.children
// ^?
https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgCpQhAcgewCYoDeAUMsggBbAA2eGIAXGhtvhANoC6A3MQL7FiCHCADOYZHGQBeZCTKUadCI2RcANP2Si4YYKJjAIo5plwFexAPRXkEAB4AHCAjBN0Ztl2JwAdItp6a1sAPQB+YiA
π» Use Cases
infer a.children to TreeNode[]
Suggestion
π Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
when we use
satisfieskeywords, infer empty array to typed array bysatisfiestarget array instead of never arrayπ Motivating Example
https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgCpQhAcgewCYoDeAUMsggBbAA2eGIAXGhtvhANoC6A3MQL7FiCHCADOYZHGQBeZCTKUadCI2RcANP2Si4YYKJjAIo5plwFexAPRXkEAB4AHCAjBN0Ztl2JwAdItp6a1sAPQB+YiA
π» Use Cases
infer
a.childrentoTreeNode[]