Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Suggestions are not listed properly for arrays of generic type in function parameters (contextual completion)Β #53555

Copy link
Copy link
@jgoux

Description

@jgoux
Issue body actions

Bug Report

πŸ”Ž Search Terms

suggestions, intellisense, autocomplete

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

declare function test<T extends 'a' | 'b'>(a: { foo: T[] }): void

// Try trigerring the suggestions within the foo array, no suggestions
test({ foo: [<cursor here, ctrl+space>] })

// Try trigerring the suggestions within the foo array, only suggestion is 'a'
test({ foo: ['a', <cursor here, ctrl+space>] })

πŸ™ Actual behavior

When the array is empty, there is no suggestions at all
When the array has items, the suggestions are restricted to the items already set in the array

πŸ™‚ Expected behavior

In both cases, we should have the full list of suggestions 'a' | 'b'

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.