-
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
Conflicting outer definition in same file: ensure source exists #17439
Conversation
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.
Otherwise LGTM
@lrytz I pushed a fix for when the inherited member is overloaded, so it's necessary to consult alternatives for source. I see I was confused by overloaded I see |
The fix exposes the overloaded
Indeed,
and
also just to cover all the bases
Edit: note |
1aa6f7d
to
ed8901c
Compare
that is
where it inherits an overloaded |
I think the ambiguity error on
is not bad, this is the sort of thing that can confuse people. |
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.
This currently fails for specs2, so it seems we need to improve the logic.
@odersky I improved specs2 instead. I think this is exactly the ambiguity that was intended originally. (See Lukas #17439 (comment)) |
Updated specs2. Locally (
related to etorreborre/specs2@947e823. Not sure what to make of it. |
Yeah, same error here. Should I revert that commit on dotty-staging? |
@lrytz that was related to #17428 I mentioned the PR (on specs2 etorreborre/specs2#1152) and that one could not tell if or when it might land. There is a request to improve debugging, but there is also the dotty PR to improve debugging inline code, which will touch line numbers. |
depending on the scala version
…iguity error"" This reverts commit ccf2f81.
An inherited member cannot shadow a definition in scope that was defined in the current compilation unit. Aliases are given a pass of sorts. Either the member or the definition may be overloaded, which complicates both detection and mitigation. Tests are for the status quo.
Ready to review (@odersky). Short history
So this PR reverts the revert, and adds the fix. |
Added a forward-port of scala/bug#12816 (package object members are not conflicting with inherited definitions). |
Follow-up for #17033, fixes #17433