Skip to content

Change syntax of what was uses_init#25720

Open
odersky wants to merge 4 commits intoscala:mainfrom
dotty-staging:change-uses-init
Open

Change syntax of what was uses_init#25720
odersky wants to merge 4 commits intoscala:mainfrom
dotty-staging:change-uses-init

Conversation

@odersky
Copy link
Copy Markdown
Contributor

@odersky odersky commented Apr 7, 2026

Now there is only a single uses clause, and constructor-only uses are marked
with initially. Example:

uses a initially, a, b

odersky added 3 commits April 7, 2026 11:14
This prepares for a change in syntax for uses_init since stdlib has to be compilable
in non-bootstrapped as well as bootstrapped settings.
Now there is only a single uses clause, and constructor-only uses are marked
with `initially`. Example:

    uses a initially, a, b
@odersky odersky requested a review from a team as a code owner April 7, 2026 10:53
@natsukagami
Copy link
Copy Markdown
Contributor

We also have @constructorOnly annotation, can the two be unified somehow?

@odersky
Copy link
Copy Markdown
Contributor Author

odersky commented Apr 7, 2026

What would be a way to unify with @constructorOnly? I don't see good options.

@natsukagami
Copy link
Copy Markdown
Contributor

Maybe uses a, @constructorOnly b, I wonder how hard it would be to parse that

@odersky odersky force-pushed the change-uses-init branch from a2f3984 to 994ee72 Compare April 7, 2026 13:17
@odersky
Copy link
Copy Markdown
Contributor Author

odersky commented Apr 7, 2026

Never mind parsing, what would the context free grammar look like?

@odersky odersky requested a review from bracevac April 7, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants