Skip to content

Don't crash when update is used as a modifier outside cc#24378

Merged
hamzaremmal merged 1 commit intoscala:mainfrom
dotty-staging:fix-24371
Nov 12, 2025
Merged

Don't crash when update is used as a modifier outside cc#24378
hamzaremmal merged 1 commit intoscala:mainfrom
dotty-staging:fix-24371

Conversation

@odersky
Copy link
Copy Markdown
Contributor

@odersky odersky commented Nov 11, 2025

We now treat update like erased and consume. The error message is still not great, maybe something can be done about that.

We now treat update like erased and consume. The error message is still not great,
maybe something can be done about that.
@hamzaremmal
Copy link
Copy Markdown
Member

Relates to #24371

Copy link
Copy Markdown
Member

@hamzaremmal hamzaremmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this work because we revive a dead path in the Scanner.

def isSoftModifier: Boolean =
token == IDENTIFIER
&& (softModifierNames.contains(name)
|| name == nme.erased && erasedEnabled
|| name == nme.tracked && trackedEnabled
|| name == nme.update && Feature.ccEnabled
|| name == nme.consume && Feature.ccEnabled)

Before, we matched in line 1230 but now we will match in line 1233.

@hamzaremmal hamzaremmal merged commit b1c4e05 into scala:main Nov 12, 2025
87 of 88 checks passed
@hamzaremmal hamzaremmal deleted the fix-24371 branch November 12, 2025 12:46
@WojciechMazur WojciechMazur added this to the 3.8.1 milestone Jan 13, 2026
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.

5 participants