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

Forward reference error includes line numbers #22534

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

Forward port of scala/scala#9654

Fixes #14401 where the line number helps the user realize they are looking at the wrong definition.

It would be nice if diagnostics could have supplementary positions for red squiggles.

This commit does not address shadowing per se.

@som-snytt
Copy link
Contributor Author

som-snytt commented Feb 6, 2025

It would be nice if supplemental squiggles were generated for an IDE but longer text with line info (for example) only in standard error output. A Diagnostic could consist of multiple parts and a mechanism to combine them into a single message (and position).

How many diagnostics would benefit from such non-local supplementary info?

This occurred to me because I considered that I don't need to be told the location of a symbol if it's on "the next line"; but that assumes I'm looking at the source (and not error output). A comment on the Scala 2 PR was that "full location string isn't useful without a caret".

scala/scala#9654 (comment)

@som-snytt som-snytt marked this pull request as ready for review February 6, 2025 22:11
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.

maybe warn when "forward reference to a local variable" is shadowing parameter.
1 participant