Skip to content

Fix implicit scope implementation #6832

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 5 commits into from
Jul 16, 2019

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 10, 2019

Change implicit scope implementation so that it can be understood and adapted to different strategies.
Based on #6824. First new commit is aa4aee6.

@odersky odersky force-pushed the fix-implicit-scope branch 4 times, most recently from 3d5bf8d to aa4aee6 Compare July 10, 2019 19:20
@odersky odersky changed the title Fix Scala2 unpickler's handling of package references Fix implicit scope implementation Jul 10, 2019
@odersky odersky force-pushed the fix-implicit-scope branch from 8c77860 to 93b4832 Compare July 11, 2019 10:14
@odersky odersky marked this pull request as ready for review July 11, 2019 10:32
@anatoliykmetyuk
Copy link
Contributor

test performance please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 1 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6832/ to see the changes.

Benchmarks is based on merging with master (15b9cd8)

@milessabin
Copy link
Contributor

@odersky @smarter this seems to have a semantic conflict with #6842. The change to the signature of Symbol#isAbsent in a92a209 breaks its use in Implicits.scala.

val companion = sym.companionModule
if (companion.exists) addRef(companion.termRef)
def addCompanion(pre: Type, companion: Symbol) =
if (companion.exists && !companion.isAbsent) comps += TermRef(pre, companion)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use of isAbsent here breaks after #6842.

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by break ? The signature of isAbsent changed, so at the very least you need to add parens to it: isAbsent()

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, yes, precisely :-)

Maybe my terminology is off here, but no git conflict, CI passes, yet will fail if merged.

odersky added 5 commits July 16, 2019 13:34
The previous implicit scope was hard to understand, and did not conform to spec. The
new implementation is simpler to understand. It also does not conform to spec as written
but there's a chance that we might change the spec to conform to it.
@odersky odersky force-pushed the fix-implicit-scope branch from 60a9c96 to fd3edbd Compare July 16, 2019 11:35
@milessabin
Copy link
Contributor

LGTM. Also verified that the technique proposed to fix shapeless after this change will work.

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