Skip to content

Nonsensical error message #23021

Closed
Closed
@ahejlsberg

Description

@ahejlsberg

TypeScript Version: 2.9.0-dev

Code

type Wat<T extends string> = { [x: T]: string };  // Error: An index signature cannot be a union type ?!?

Expected behavior:

Meaningful error message.

Actual behavior:

Error message complains about a union type, but there is no union type.

Related Issues:

The error message is caused by #20726. There is no verification that the type is actually a union type.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions