Skip to content
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

Can use 'readonly' as type-name but cannot make use of it #42760

Open
jrieken opened this issue Feb 11, 2021 · 2 comments
Open

Can use 'readonly' as type-name but cannot make use of it #42760

jrieken opened this issue Feb 11, 2021 · 2 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Feb 11, 2021

Bug Report

  • ts 4.1.3
  • take the snippet below
  • you get unexpected compile errors on the property declaration
type readonly = 'readonly';
class Fun {
	readonly readonly: readonly = 'readonly';
}
@jrieken
Copy link
Member Author

jrieken commented Feb 11, 2021

This issue might be one for the bin but my goal is to write a long sausage of readonly, like

type readonly = readonly readonly[]
class Fun {
	readonly readonly: readonly = []
}

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

A noble endeavor, to be sure.

The type readonly = '' declaration should be made illegal.

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
Development

No branches or pull requests

2 participants