Skip to content

Missing IntelliSense for optional property from array type constraintsΒ #43917

@zheeeng

Description

@zheeeng

Bug Report

πŸ”Ž Search Terms

πŸ•— Version & Regression Information

searched a related issue: #30058

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

type ZZZ = {
    bar?: number,
    foo: string
}

function test<T extends ZZZ>(c: T) {

}

function testArr<T extends ZZZ[]>(c: T) {

}

// case 1:
test({
    // foo got intellisense
    // bar got intellisense
})

// case 2:
test({
    foo: '333',
    // bar got intellisense
})

// case 3:
testArr([
    {
        foo: '111',
        // bar got no intellisense
    },
])

// case 4:
testArr([
    {
        // foo got intellisense
        // bar got intellisense
    }
]);

πŸ™ Actual behavior

case 3 missing the IntelliSense for option property bar

πŸ™‚ Expected behavior

show completion for property bar

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions