Skip to content

Keyof Autocompletion does not work when there is only one member #15623

@hediet

Description

@hediet

TypeScript Version: 2.3 (Playground)

Code

type Bla = { item1: number };
function f<TKey extends keyof Bla>(key: TKey) {}

f("|");

Expected behavior:
Autocomplete suggests item1 at position |.

Actual behavior:
Autocomplete does not suggest anything:
image

Remark
It works as expected if Bla has more than one member:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    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