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

Enable more Scala.js tests, fix two issues #7112

Merged
merged 4 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class LinkScala2Impls extends MiniPhase with IdentityDenotTransformer { thisPhas
def currentClass = ctx.owner.enclosingClass.asClass
app match {
case Apply(sel @ Select(Super(_, _), _), args)
if sel.symbol.owner.is(Scala2x) && currentClass.mixins.contains(sel.symbol.owner) =>
if sel.symbol.owner.is(Scala2x) && currentClass.mixins.contains(sel.symbol.owner) && !ctx.settings.scalajs.value =>
Copy link
Member

@smarter smarter Aug 27, 2019

Choose a reason for hiding this comment

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

I think we could go further and use the default method even when not using Scala.js, going through the static methods is supposed to improve cold performance but based on the investigation I did, they shouldn't affect semantics (#5928)

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 don't object, but I would argue that it is out of scope of this PR. I would keep this PR to be Scala.js-only. Changing the JVM behavior should be done in a separate PR I think.

Copy link
Member

Choose a reason for hiding this comment

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

Your call, but I'd like to keep the difference in code paths taken when scala.js is enabled to a minimum.

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 haven't managed to make it work for the JVM in 20 minutes. I think changing the JVM should be best done by someone who understand the thing better than I do.

val impl = implMethod(sel.symbol)
if (impl.exists) Apply(ref(impl), This(currentClass) :: args).withSpan(app.span)
else app // could have been an abstract method in a trait linked to from a super constructor
Expand Down
1 change: 1 addition & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ object Build {
val dir = fetchScalaJSSource.value / "test-suite"
(
(dir / "shared/src/test/scala/org/scalajs/testsuite/compiler" ** "IntTest.scala").get
++ (dir / "shared/src/test/scala/org/scalajs/testsuite/javalib/lang" ** "IntegerTest.scala").get
++ (dir / "shared/src/test/require-jdk8/org/scalajs/testsuite/javalib/util" ** "Base64Test.scala").get
++ (dir / "shared/src/test/scala/org/scalajs/testsuite/utils" ** "*.scala").get
)
Expand Down