-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Clarify ambiguous reference error message #16137
Clarify ambiguous reference error message #16137
Conversation
e5bd505
to
bc978cd
Compare
bc978cd
to
4ed780a
Compare
@dwijnand please review? Surprisingly difficult rebase over refactor of messages.scala, so if it is not accepted, I will drop it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, sorry you waited this long... :(
I have a question, but I don't mind merging this without that change.
| - Names introduced by imports | ||
| - Named imports take precedence over wildcard imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this?
| - Names introduced by imports | |
| - Named imports take precedence over wildcard imports | |
| - Names introduced by named imports | |
| - Names introduced by wildcard imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I was trying to strike a balance of informality.
4ed780a
to
363996c
Compare
Added a commit which finds words for "Named import" is too brief to ring with clarity. There must be a grammatical term for "by import" (similar to "call by name"), as opposed to "by imports" or "by importing". The follow-up also restores the previous words in the note: the rule of thumb that defs are preferred to imports, and the special mention of the "new" rule, with a clause explaining when it is relevant:
Thanks, Dale, for the nudge. No one will say, We didn't adopt Scala 3 because of that stupid message, but I must believe that a collective, cumulative effort must make a difference, not only in aggregate but in the life of some Scala learner yet unborn. |
✊ |
Fixes #12682
Name binding is tricky because of the intersection of binding precedence and scope.
I think this states the matter most succinctly: Lower precedence cannot shadow higher.
Also modernized the syntax.
It's arguably weird for the compiler to refer to itself in the third person:
Less nerdy and more former schoolmarm: