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

Consider reserving keywords for upcoming features #6096

Open
markcowl opened this issue Feb 21, 2025 · 1 comment
Open

Consider reserving keywords for upcoming features #6096

markcowl opened this issue Feb 21, 2025 · 1 comment
Labels
1_0_E2E breaking-change A change that might cause specs or code to break compiler:core Issues for @typespec/compiler design:needed A design request has been raised that needs a proposal triaged:core
Milestone

Comments

@markcowl
Copy link
Contributor

markcowl commented Feb 21, 2025

All those reservations needs to  only prevent declaration names to use them, property, variant and enum member names should all be allowed to use those.

Potential keywords:

  • flag (For a flag enum, I think it might be quite beneficial for doing built in things like Foo.a | Foo.b)
  • data We talked many times about having data decorators(auto set and provide read accessor for the input)
  • state We talked about the possibility to define state engine in TypeSpec
  • partial Partial models
  • macro Macros
  • private Mark types as private
  • local Mark types/const as local/private
  • keyof Similar to typescript
  • package Some package declaration
  • metadata Metadata registration
  • env define environment(Retrieve value from environemnt variable)
  • arg similar but with some Cli arguments
  • declare Keyword for making a declaration of an expression(unification of expression and declaration)
  • sealed Explicitly seal a model
  • array if we ever wanted to try to detach arrays from models
  • struct similar to above

If we add back some logic into the language(if else will remain reserved after projection removal)

  • switch
  • case
  • match
@markcowl markcowl added 1_0_E2E compiler:core Issues for @typespec/compiler design:needed A design request has been raised that needs a proposal labels Feb 21, 2025
@markcowl markcowl modified the milestones: [2025] April, [2025] March Feb 24, 2025
@markcowl markcowl added triaged:core breaking-change A change that might cause specs or code to break labels Feb 24, 2025
@chrisradek
Copy link
Member

We also talked about sealed as a potential keyword to explicitly say nothing new can be added - even when extending a sealed model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1_0_E2E breaking-change A change that might cause specs or code to break compiler:core Issues for @typespec/compiler design:needed A design request has been raised that needs a proposal triaged:core
Projects
None yet
Development

No branches or pull requests

2 participants