Skip to content

Upgrade to Scala.js 1.0.0-RC2. #7787

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 2 commits into from
Dec 17, 2019
Merged

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Dec 17, 2019

This includes changes to the contract of calling static methods in Java-defined classes. They are now actually called as static methods in the IR.

We also generate static forwarders for public methods in static objects.

These changes are a forward-port of scala-js/scala-js@f94713b

The only real difference is that in scalac, we emit a compile error if the companion class contains any public static method, because scalac does not otherwise produce public static methods at the moment. Since dotty does generate public static methods for the bodies of SAMs, we only complain if there is an actual clash.

Now that we have non-mangled names as `ClassDef`'s names, we can
derive the corresponding file names from that, instead of having to
carry around the original symbol and an optional suffix.

This is a forward port of
scala-js/scala-js@44996ce
@sjrd sjrd requested a review from smarter December 17, 2019 10:09
Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Commit Messages

We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).

Please stick to these guidelines for commit messages:

  1. Separate subject from body with a blank line
  2. When fixing an issue, start your commit message with Fix #<ISSUE-NBR>:
  3. Limit the subject line to 72 characters
  4. Capitalize the subject line
  5. Do not end the subject line with a period
  6. Use the imperative mood in the subject line ("Add" instead of "Added")
  7. Wrap the body at 80 characters
  8. Use the body to explain what and why vs. how

adapted from https://chris.beams.io/posts/git-commit

Have an awesome day! ☀️

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

}
}

private lazy val dontUseExitingUncurryForForwarders =
Copy link
Member

Choose a reason for hiding this comment

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

dead code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

}.toSet

val members = {
// Copied from DottyBackendInterface.ExcludedForwarderFlags
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't you call into it instead of copying it ? It's not impossible that it will change in the future.

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 couldn't because it was defined in the class DottyBackendInterface, and it was overkill to instantiate that from the Scala.js back-end.

I moved the definition to a new companion object of DottyBackendInterface and now I use that one from here.

This includes changes to the contract of calling static methods in
Java-defined classes. They are now actually called as static
methods in the IR.

We also generate static forwarders for public methods in static
objects.

These changes are a forward-port of
scala-js/scala-js@f94713b

The only real difference is that in scalac, we emit a compile error
if the companion class contains *any* public static method, because
scalac does not otherwise produce public static methods at the
moment. Since dotty does generate public static methods for the
bodies of SAMs, we only complain if there is an actual clash.
@sjrd sjrd force-pushed the scalajs-1.0.0-RC2 branch from 1f8d5cd to c99d407 Compare December 17, 2019 14:48
@sjrd sjrd requested a review from smarter December 17, 2019 14:50
@sjrd sjrd merged commit fa9a48e into scala:master Dec 17, 2019
@sjrd sjrd deleted the scalajs-1.0.0-RC2 branch December 17, 2019 15:43
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.

3 participants