Skip to content

patvar: adjust caret in error message #23115

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

nox213
Copy link
Contributor

@nox213 nox213 commented May 7, 2025

| Type ascriptions after patterns other than:
| * variable pattern, e.g. `case x: String =>`
| * number literal pattern, e.g. `case 10.5: Double =>`
| are no longer supported. Remove the type ascription or move it to a separate variable pattern.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, this line is commented out in Scala 2 because parser doesn't recover.

| Type ascriptions after patterns other than:
| * variable pattern, e.g. `case x: String =>`
| * number literal pattern, e.g. `case 10.5: Double =>`
| are no longer supported. Remove the type ascription or move it to a separate variable pattern.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I didn't notice it before; I was distracted by the long message and the fact that Scala 2 doesn't support it.

One could misquote the saying about seeing the caret in one's brother's eye.

@som-snytt som-snytt enabled auto-merge (rebase) May 7, 2025 15:54
@som-snytt som-snytt merged commit c49ff71 into scala:main May 7, 2025
28 checks passed
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.

2 participants