Skip to content

Reserved type primitive names should not be allowed as interface names #43215

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
reverofevil opened this issue Mar 12, 2021 · 1 comment Β· Fixed by #43217
Closed

Reserved type primitive names should not be allowed as interface names #43215

reverofevil opened this issue Mar 12, 2021 · 1 comment Β· Fixed by #43217
Labels
Bug A bug in TypeScript
Milestone

Comments

@reverofevil
Copy link

Bug Report

πŸ”Ž Search Terms

interface never

πŸ•— Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about Classes

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

interface never {
    never: true;
}
declare const x: never;
x.never

πŸ™ Actual behavior

Property 'never' does not exist on type 'never'.(2339)
Why can't I use a property I defined?

πŸ™‚ Expected behavior

Property never should exist on type never, despite their names.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Mar 12, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 12, 2021
@RyanCavanaugh
Copy link
Member

interface never { should be a syntax error

@DanielRosenwasser DanielRosenwasser added Breaking Change Would introduce errors in existing code and removed Breaking Change Would introduce errors in existing code labels Mar 12, 2021
@DanielRosenwasser DanielRosenwasser changed the title Property is never available on interface, even though it's defined Reserved type primitive names should not be allowed as interface names Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
3 participants