Skip to content

Bad error message for type used as index #25770

@ghost

Description

TypeScript Version: 3.1.0-dev.20180717

Code

type S = "a" | "b";
type O = { [S]: number };

Expected behavior:

Error message telling me to use K in S.

Actual behavior:

src/a.ts:2:13 - error TS2693: 'S' only refers to a type, but is being used as a value here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions