Open zheeeng opened 3 years ago
I would like to demonstrate how autocomplete is influenced by several items in array:
type ZZZ = {
foo: number;
bar?: number;
baz?: number;
}
function testArr<T extends ZZZ[]>(c: T) {
}
// case 1:
testArr([
{
foo: 1,
baz: 1
},
{
foo: 1,
//baz has autcomplete
//bar missing autocomplete
}
]);
// case 2:
testArr([
{
foo: 1,
//Neither baz or bar have autcomplete
},
{
foo: 1,
//Neither baz or bar have autcomplete
}
]);
// case 3:
testArr([
{
foo: 1,
//bar and baz appear in autcomplete
},
{
foo: 1,
bar: 1,
//bar and baz appear in autcomplete
},
{
//bar, baz and foo appear in autocomplete
}
]);
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
searched a related issue: https://github.com/microsoft/TypeScript/issues/30058
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
case 3 missing the IntelliSense for option property
bar
🙂 Expected behavior
show completion for property
bar