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

New trait encoding using default methods [ci: last-only] #5003

Merged
merged 4 commits into from Mar 21, 2016

Conversation

Projects
None yet
7 participants
@retronym
Member

retronym commented Mar 1, 2016

Until now, concrete methods in traits were encoded with "trait implementation classes".

  • Such a trait would compile to two class files
    • the trait interface, a Java interface, and
    • the implementation class, containing "trait implementation methods"
  • trait implementation methods are static methods has an explicit self parameter.
  • some methods don't require addition of an interface method, such as private methods. Calls to these directly call the implementation method
  • classes that mixin a trait install "trait forwarders", which implement the abstract method in the interface by forwarding to the trait implementation method.

The new encoding:

  • no longer emits trait implementation classes or trait implementation methods.
  • instead, concrete methods are simply retained in the interface, as JVM 8 default interface methods (the JVM spec changes in JSR-335 paves the way)
  • use invokespecial to call private or particular super implementations of a method (rather invokestatic)
    • in cases when we invokespecial to a method in an indirect ancestor, we add that ancestor redundantly as a direct parent. We are investigating alternatives approaches here.
  • we still emit trait fowrarders, although we are investigating ways to only do this when the JVM would be unable to resolve the correct method using its rules for default method resolution.

Here's an example:

trait T {
  println("T")
  def m1 = m2
  private def m2 = "m2"
}
trait U extends T {
  println("T")
  override def m1 = super[T].m1
}
class C extends U {
  println("C")
  def test = m1
}

The old and new encodings are displayed and diffed here: https://gist.github.com/retronym/f174d23f859f0e053580

Bootstrapping Plan

  • Update the bootstrap script to generate docs on the second pass of the modules bootstrap when a custom STARR is used.
  • Trigger scala-2.12.x-integrate-bootstrap, with publishToSonatype=true and STARR_REF=c8e6050 and SCALA_VER_SUFFIX=-M3-dc9effe ("Nuke implementation classes"): scala-2.12.x-integrate-bootstrap/351
  • Tag dc9effe (" Remove manual mixins in JFunctionN") as v2.11.0-M3-dc9effe
  • Promote the resulting release (including modules) to Maven Central.
  • Ask @rickynils to publish a ScalaCheck release against this build. (We used a locally built version during the bootstrap script, but that won't be available when we use this as a STARR)
  • Rework ("Update STARR to freshly bootstrapped build") to set starr.version=v2.11.0-M4-089b836 and remove the temporary build scaffolding to use the release-temp repository.
  • Merge this PR. dc9effe will be the only commit that doesn't build directly (it only builds with bootstrap STARR_REF=HEAD^1 ..)
  • Update the references to 2.12.0-M3 in the scalaVersion override for scala-{xml, parser-combinators} in the community build.

Variations to discuss:

  • Squash the last commits in this PR back into "Nuke implementation classes" before doing this.
  • Squash "Nuke implementation classes", "Remove manual mixins in JFunctionN", and "Update STARR to freshly bootstrapped build" before merging to 2.12.x, with a commit message that points to the tag v2.11.0-M4-089b836 which contains the finer grained commits. (Verdict: we don't need to do this.)
  • Does the tag v2.11.0-M3-089b836 make more sense? Ideally, Maven's ordering scheme would consider 2.11.0-M3 < XXXXX-089b836 < 2.11.0-M4. Decision: Use M3-

@scala-jenkins scala-jenkins added this to the 2.12.0-M4 milestone Mar 1, 2016

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 1, 2016

Member

Note that the commits are ordered as follows:

⚡ git log --oneline 2.12.x..
083ee4f Update STARR to freshly bootstrapped build
3ecc141 Remove manual mixins in JFunctionN.
902bb54 Nuke trait implementation classes
Member

retronym commented Mar 1, 2016

Note that the commits are ordered as follows:

⚡ git log --oneline 2.12.x..
083ee4f Update STARR to freshly bootstrapped build
3ecc141 Remove manual mixins in JFunctionN.
902bb54 Nuke trait implementation classes

@retronym retronym changed the title from WIP new trait encoding using default methods [ci:last-only] to WIP new trait encoding using default methods [ci: last-only] Mar 1, 2016

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 1, 2016

Member

/sync

Member

retronym commented Mar 1, 2016

/sync

@retronym retronym added the on-hold label Mar 1, 2016

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 9, 2016

Member
[zinc] java.lang.NoClassDefFoundError: scala/Product$class
[zinc]  at scala.util.parsing.json.JSONArray.<init>(Parser.scala:103)
[zinc]  at scala.tools.nsc.doc.html.page.IndexScript.scala$tools$nsc$doc$html$page$IndexScript$$$anonfun$2(IndexScript.scala:45)
[zinc]  at scala.tools.nsc.doc.html.page.IndexScript$$Lambda$2929/1019011979.apply(Unknown Source)
[zinc]  at scala.collection.TraversableLike.scala$collection$TraversableLike$$$anonfun$3(TraversableLike.scala:234)
[zinc]  at scala.collection.TraversableLike$$Lambda$124/404499565.apply(Unknown Source)
[zinc]  at scala.collection.immutable.Map$Map3.foreach(Map.scala:176)
Member

retronym commented Mar 9, 2016

[zinc] java.lang.NoClassDefFoundError: scala/Product$class
[zinc]  at scala.util.parsing.json.JSONArray.<init>(Parser.scala:103)
[zinc]  at scala.tools.nsc.doc.html.page.IndexScript.scala$tools$nsc$doc$html$page$IndexScript$$$anonfun$2(IndexScript.scala:45)
[zinc]  at scala.tools.nsc.doc.html.page.IndexScript$$Lambda$2929/1019011979.apply(Unknown Source)
[zinc]  at scala.collection.TraversableLike.scala$collection$TraversableLike$$$anonfun$3(TraversableLike.scala:234)
[zinc]  at scala.collection.TraversableLike$$Lambda$124/404499565.apply(Unknown Source)
[zinc]  at scala.collection.immutable.Map$Map3.foreach(Map.scala:176)

adriaanm added a commit to adriaanm/community-builds that referenced this pull request Mar 9, 2016

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 9, 2016

Member
Member

adriaanm commented Mar 9, 2016

@retronym retronym changed the title from WIP new trait encoding using default methods [ci: last-only] to New trait encoding using default methods [ci: last-only] Mar 16, 2016

@adriaanm adriaanm self-assigned this Mar 16, 2016

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 16, 2016

Member

LGTM!

Member

adriaanm commented Mar 16, 2016

LGTM!

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 16, 2016

Member

Note to admins: this PR can't be merged as is, we need to manually pull a few levers to publish to publish the new STARR and bootstrap.

Member

retronym commented Mar 16, 2016

Note to admins: this PR can't be merged as is, we need to manually pull a few levers to publish to publish the new STARR and bootstrap.

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 16, 2016

Member

How about adding the https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/ repo instead of the release-temp one and using 2.12.0-73e4038-SNAPSHOT for STARR?

Member

adriaanm commented Mar 16, 2016

How about adding the https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/ repo instead of the release-temp one and using 2.12.0-73e4038-SNAPSHOT for STARR?

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 16, 2016

Member

Sounds like a good plan. I've just rebased, so I've triggered a build of the latest version of the "Nuke impl classes" commit, scala-2.12.x-validate-publish-core/1504. That can serve as the STARR for the subsequent commits.

We can revert the change to include pr-validation-snapshots as a Ant/SBT resolver after we re-STARR again (either immediately after merging this PR, or after the release of 2.12.0-M4)

Member

retronym commented Mar 16, 2016

Sounds like a good plan. I've just rebased, so I've triggered a build of the latest version of the "Nuke impl classes" commit, scala-2.12.x-validate-publish-core/1504. That can serve as the STARR for the subsequent commits.

We can revert the change to include pr-validation-snapshots as a Ant/SBT resolver after we re-STARR again (either immediately after merging this PR, or after the release of 2.12.0-M4)

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 16, 2016

Member

No wait I'm confusing myself again.

Member

retronym commented Mar 16, 2016

No wait I'm confusing myself again.

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 16, 2016

Member

Your comment seems fine, except that we can't remove the resolver until we have a release on maven. My comment should also be amended to use the sha of the commit before the one that introduces the new STARR, if we decide to drop the old approach of using scala-release-temp (instead of just tacking on another commit). I'm fine with keeping a few commits in history that are suboptimal, as long as they all build.

Member

adriaanm commented Mar 16, 2016

Your comment seems fine, except that we can't remove the resolver until we have a release on maven. My comment should also be amended to use the sha of the commit before the one that introduces the new STARR, if we decide to drop the old approach of using scala-release-temp (instead of just tacking on another commit). I'm fine with keeping a few commits in history that are suboptimal, as long as they all build.

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 16, 2016

Member

We need to run the bootstrap job to get builds of the modules, it is not enough to use the result of publishCore as STARR. If we can get that job to publish into pr-validation-snapshots rather than release-temp, however, life might be simpler.

Member

retronym commented Mar 16, 2016

We need to run the bootstrap job to get builds of the modules, it is not enough to use the result of publishCore as STARR. If we can get that job to publish into pr-validation-snapshots rather than release-temp, however, life might be simpler.

@lrytz

This comment has been minimized.

Show comment
Hide comment
@lrytz

lrytz Mar 16, 2016

Member

In the interest of reproducible builds there shouldn't be revisions in the git history that depend on artifacts stored in transient repositories (pr-validation-snapshots / scala-release-temp). Is this the case here?

Member

lrytz commented Mar 16, 2016

In the interest of reproducible builds there shouldn't be revisions in the git history that depend on artifacts stored in transient repositories (pr-validation-snapshots / scala-release-temp). Is this the case here?

@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Mar 16, 2016

Member

Stupid question: why not simply publish M4 with whatever new STARR you need, then publish M5 with these changes, depending on M5?

Wasn't there some agreement at some point that builds should only ever use a published version as STARR?

Member

sjrd commented Mar 16, 2016

Stupid question: why not simply publish M4 with whatever new STARR you need, then publish M5 with these changes, depending on M5?

Wasn't there some agreement at some point that builds should only ever use a published version as STARR?

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 16, 2016

Member

I agree it would be preferable to have the new STARR published to Maven. We could give this an arbitrary name 2.12.0-M4-<shortsha>, if we'd prefer not to "use up" a milestone number.

Member

retronym commented Mar 16, 2016

I agree it would be preferable to have the new STARR published to Maven. We could give this an arbitrary name 2.12.0-M4-<shortsha>, if we'd prefer not to "use up" a milestone number.

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 16, 2016

Member

Right, forgot about the modules. Let's publish M4-<shortsha>.

Member

adriaanm commented Mar 16, 2016

Right, forgot about the modules. Let's publish M4-<shortsha>.

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 16, 2016

Member

That'll also be more easily reproducible than my suggestion.

Member

adriaanm commented Mar 16, 2016

That'll also be more easily reproducible than my suggestion.

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 17, 2016

Member

[moved release plan to PR description]

Member

retronym commented Mar 17, 2016

[moved release plan to PR description]

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 17, 2016

Member

Sounds like a plan!

Member

adriaanm commented Mar 17, 2016

Sounds like a plan!

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 17, 2016

Member

I'm currently running the tip of this PR through the release build. This is a preview of what M4 would look like. The release will end up in scala-2.12.0-af98223-nightly.tgz within an hour or so.

I'm going to use this to do a few sanity checks (e.g. for performance).

Member

retronym commented Mar 17, 2016

I'm currently running the tip of this PR through the release build. This is a preview of what M4 would look like. The release will end up in scala-2.12.0-af98223-nightly.tgz within an hour or so.

I'm going to use this to do a few sanity checks (e.g. for performance).

@lrytz

This comment has been minimized.

Show comment
Hide comment
@lrytz

lrytz Mar 17, 2016

Member

@retronym am i right that the fix for SD-86 (available here retronym#19) is not yet in this commits? that's fine with me, i just need to remember to submit it to scala/scala once this is merged, before m4.

Member

lrytz commented Mar 17, 2016

@retronym am i right that the fix for SD-86 (available here retronym#19) is not yet in this commits? that's fine with me, i just need to remember to submit it to scala/scala once this is merged, before m4.

@adriaanm

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm Mar 21, 2016

Member

Gladly! 🎊

Member

adriaanm commented Mar 21, 2016

Gladly! 🎊

adriaanm added a commit that referenced this pull request Mar 21, 2016

Merge pull request #5003 from retronym/topic/nuke-impl-classes-sans-f…
…ields

New trait encoding using default methods

@adriaanm adriaanm merged commit 06485eb into scala:2.12.x Mar 21, 2016

5 checks passed

cla @retronym signed the Scala CLA. Thanks!
Details
integrate-ide [1324] SUCCESS. Took 12 s.
Details
validate-main Failure overridden. Nothing to see here.
Details
validate-publish-core [1524] SUCCESS. Took 4 min.
Details
validate-test [1326] SUCCESS. Took 59 min.
Details
@smarter

This comment has been minimized.

Show comment
Hide comment
@smarter

smarter Mar 21, 2016

Contributor

Congrats! @retronym: Are you aware of any differences between the 2.12 trait encoding and Dotty trait encoding? It'd be great if we could align them.

Contributor

smarter commented Mar 21, 2016

Congrats! @retronym: Are you aware of any differences between the 2.12 trait encoding and Dotty trait encoding? It'd be great if we could align them.

@retronym

This comment has been minimized.

Show comment
Hide comment
@retronym

retronym Mar 21, 2016

Member

@smarter Thanks! Our encoding of fields (and the way that they are desugared in the compilation pipeline) is still somewhat different. @adriaanm is working towards bringing that closer together in #5035 (although we don't have the intention of replicating the initialize methods, just the place that the desugaring happens in the pipeline.)

Member

retronym commented Mar 21, 2016

@smarter Thanks! Our encoding of fields (and the way that they are desugared in the compilation pipeline) is still somewhat different. @adriaanm is working towards bringing that closer together in #5035 (although we don't have the intention of replicating the initialize methods, just the place that the desugaring happens in the pipeline.)

@retronym retronym removed the on-hold label Mar 21, 2016

@smarter smarter referenced this pull request Mar 21, 2016

Closed

Class-based dependency tracking in name hashing algorithm #1104

19 of 20 tasks complete

retronym added a commit to retronym/scala that referenced this pull request May 19, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request May 19, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request May 19, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request May 25, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request May 31, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 1, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/scala that referenced this pull request Jun 9, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

retronym added a commit to retronym/community-builds that referenced this pull request Jun 9, 2016

Test config for trait-statics
scala/scala#5003

Currently using a hash from a yesterdays version of
this PR, will update again after

  https://scala-ci.typesafe.com/view/scala-2.12.x/job/scala-2.12.x-integrate-bootstrap/457/console

completes

retronym added a commit to retronym/scala that referenced this pull request Jun 9, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  #27                 // Method $init$:(LT;)V
       4: return
}
```

adriaanm added a commit to adriaanm/community-builds that referenced this pull request Jun 14, 2016

Test config for trait-statics
scala/scala#5003

Currently using a hash from a yesterdays version of
this PR, will update again after

  https://scala-ci.typesafe.com/view/scala-2.12.x/job/scala-2.12.x-integrate-bootstrap/457/console

completes

adriaanm added a commit to adriaanm/scala that referenced this pull request Jun 28, 2016

Remove nonsensical body for trait getter
This corrects an error in the change to the trait encoding
in scala#5003: getters in traits should have empty bodies and
be emitted as abstract.

```
% ~/scala/2.12.0-M4/bin/scalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public int x();
    Code:
       0: aload_0
       1: invokeinterface #15,  1           // InterfaceMethod x:()I
       6: ireturn

  public int y();
    Code:
       0: aload_0
       1: invokeinterface #20,  1           // InterfaceMethod y:()I
       6: ireturn

  public void y_$eq(int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
       7: return

  public void $init$();
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface scala#29,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #24,  2           // InterfaceMethod y_$eq:(I)V
      16: return
}

% qscalac sandbox/test.scala && javap -c T
Compiled from "test.scala"
public interface T {
  public abstract void T$_setter_$x_$eq(int);

  public abstract int x();

  public abstract int y();

  public abstract void y_$eq(int);

  public static void $init$(T);
    Code:
       0: aload_0
       1: bipush        42
       3: invokeinterface #21,  2           // InterfaceMethod T$_setter_$x_$eq:(I)V
       8: aload_0
       9: bipush        24
      11: invokeinterface #23,  2           // InterfaceMethod y_$eq:(I)V
      16: return

  public void $init$();
    Code:
       0: aload_0
       1: invokestatic  scala#27                 // Method $init$:(LT;)V
       4: return
}
```

@adriaanm adriaanm added 2.12.0 and removed 2.12 labels Oct 29, 2016

@tanishiking tanishiking referenced this pull request Feb 16, 2018

Merged

Support for Scala-2.12 #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment