Skip to content

Nonsensical error message #23021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahejlsberg opened this issue Mar 30, 2018 · 1 comment
Closed

Nonsensical error message #23021

ahejlsberg opened this issue Mar 30, 2018 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@ahejlsberg
Copy link
Member

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.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 30, 2018

@kujon wanna take a crack at this one as well?

@mhegazy mhegazy added the Bug A bug in TypeScript label Mar 30, 2018
@mhegazy mhegazy added this to the TypeScript 2.9 milestone Mar 30, 2018
@mhegazy mhegazy added the Help Wanted You can do this label Mar 30, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 2, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants