Skip to content

More efficient code for deciding if a mixin forwarders is needed#5116

Merged
lrytz merged 1 commit intoscala:2.12.xfrom
lrytz:sd98-followup
Apr 25, 2016
Merged

More efficient code for deciding if a mixin forwarders is needed#5116
lrytz merged 1 commit intoscala:2.12.xfrom
lrytz:sd98-followup

Conversation

@lrytz
Copy link
Member

@lrytz lrytz commented Apr 22, 2016

Follow-up for #5085

@scala-jenkins scala-jenkins added this to the 2.12.0-M5 milestone Apr 22, 2016
val m = member.overriddenSymbol(baseClass)
val isCompeting = m.exists && {
!m.owner.isTraitOrInterface ||
(!m.isDeferred && !mixinSuperInterfaces.contains(m.owner))
Copy link
Member

Choose a reason for hiding this comment

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

How did you weigh the choice between this formulation mixinSuperInterfaces.contains(m.owner) and my proposal of mixinClass.isNonBottomSubclass(m.owner)? The latter amounts to a binary search over an existing data structure (the base type seq).

Copy link
Member Author

Choose a reason for hiding this comment

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

I had a failure at some point because isNonBottomSubclass includes parent classes (not only traits/interfaces). I can't remember the details, so I pushed a commit here and trying it out. It looks like class members are handled in the line above (m.owner.isTraitOrInterface) so it shouldn't make a difference.

@adriaanm
Copy link
Contributor

JavaUniverseForce needs an update:

--- a
+++ b
@@ -379,2 +379,3 @@
     definitions.ImplicitAmbiguousClass
+    definitions.JUnitTestClass
     definitions.MigrationAnnotationClass
// Generated Code, validated by run/t6240-universe-code-gen.scala
package scala.reflect
package runtime

trait JavaUniverseForce { self: runtime.JavaUniverse  =>

Also adds a warning on junit test methods that compile as default
methods.
@lrytz
Copy link
Member Author

lrytz commented Apr 25, 2016

rebased, review by @retronym

@retronym
Copy link
Member

LGTM

@lrytz lrytz merged commit 93f209d into scala:2.12.x Apr 25, 2016
@lrytz lrytz deleted the sd98-followup branch May 23, 2016 08:42
@adriaanm adriaanm added 2.12 and removed 2.12 labels Oct 29, 2016
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.

4 participants