Closed
Conversation
- The @migration annotation can now be used like @Deprecation, old syntax is still supported, but deprecated. - Improved the wording and the consistency of most migration messages, migration warnings now also show the version the change occurred. - Adjusted test. - Partially fixes SI-4990.
Contributor
|
This looks pretty good. Since "2.8" and "2.9" are technically not versions of scala, can you change all those strings to "2.8.0" and "2.9.0". Also, can you please read http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html and author your commit messages accordingly. |
Contributor
Author
|
I left out the patch number because I decided that I didn't want to check every single migrated method when it changed exactly. I'll change it and add ".0". |
Contributor
|
Nothing which merits a migration warning should ever be introduced in a point release (which isn't to say it never happened, but it'll at worst be the rare exception.) |
Contributor
Author
|
Ok. New pull request is up. |
gkossakowski
added a commit
to gkossakowski/scala
that referenced
this pull request
Jan 11, 2012
densh
pushed a commit
to densh/scala
that referenced
this pull request
Mar 20, 2013
Fixes strap.scalacheck build by adding reflect to the classpath
retronym
referenced
this pull request
in retronym/scala
Dec 12, 2016
VarHandles bring a host of new "polymorphic signature" methods to
the Java 9 standard library. This commit updates the way we detect
such methods to look at the absense/presense of the
`PolymorphicSignature` annotation, so as to include these (and any
future additions.)
When we see applications of such methods, we disable adaptation
of argument and return types.
Tested manually with JDK9-ea:
```
Welcome to Scala 2.12.2-20161208-165912-3de1c0c (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea).
Type in expressions for evaluation. Or try :help.
scala> import java.lang.invoke._, scala.runtime.IntRef
import java.lang.invoke._
import scala.runtime.IntRef
scala> val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]);
varHandle: java.lang.invoke.VarHandle = java.lang.invoke.VarHandleInts$FieldInstanceReadWrite@7112ce6
scala> varHandle.getAndSet(ref, 1): Int
res5: Int = 0
scala> varHandle.getAndSet(ref, 1): Int
res6: Int = 1
```
Inspecting bytecode shows the absense of box/unboxing:
```
object Test {
import java.lang.invoke._, scala.runtime.IntRef
val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]);
def main(args: Array[String]): Unit = {
val i : Int = varHandle.getAndSet(IntRef.zero, 1)
}
}
```
```
public void main(java.lang.String[]);
Code:
0: aload_0
1: invokevirtual #28 // Method varHandle:()Ljava/lang/invoke/VarHandle;
4: invokestatic #34 // Method scala/runtime/IntRef.zero:()Lscala/runtime/IntRef;
7: iconst_1
8: invokevirtual #40 // Method java/lang/invoke/VarHandle.getAndSet:(Lscala/runtime/IntRef;I)I
11: istore_2
12: return
```
retronym
referenced
this pull request
in retronym/scala
Dec 12, 2016
VarHandles bring a host of new "polymorphic signature" methods to
the Java 9 standard library. This commit updates the way we detect
such methods to look at the absense/presense of the
`PolymorphicSignature` annotation, so as to include these (and any
future additions.)
When we see applications of such methods, we disable adaptation
of argument and return types.
Tested manually with JDK9-ea:
```
Welcome to Scala 2.12.2-20161208-165912-3de1c0c (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea).
Type in expressions for evaluation. Or try :help.
scala> import java.lang.invoke._, scala.runtime.IntRef
import java.lang.invoke._
import scala.runtime.IntRef
scala> val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]);
varHandle: java.lang.invoke.VarHandle = java.lang.invoke.VarHandleInts$FieldInstanceReadWrite@7112ce6
scala> varHandle.getAndSet(ref, 1): Int
res5: Int = 0
scala> varHandle.getAndSet(ref, 1): Int
res6: Int = 1
```
Inspecting bytecode shows the absense of box/unboxing:
```
object Test {
import java.lang.invoke._, scala.runtime.IntRef
val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]);
def main(args: Array[String]): Unit = {
val i : Int = varHandle.getAndSet(IntRef.zero, 1)
}
}
```
```
public void main(java.lang.String[]);
Code:
0: aload_0
1: invokevirtual #28 // Method varHandle:()Ljava/lang/invoke/VarHandle;
4: invokestatic #34 // Method scala/runtime/IntRef.zero:()Lscala/runtime/IntRef;
7: iconst_1
8: invokevirtual #40 // Method java/lang/invoke/VarHandle.getAndSet:(Lscala/runtime/IntRef;I)I
11: istore_2
12: return
```
retronym
referenced
this pull request
in retronym/scala
Dec 12, 2016
VarHandles bring a host of new "polymorphic signature" methods to
the Java 9 standard library. This commit updates the way we detect
such methods to look at the absense/presense of the
`PolymorphicSignature` annotation, so as to include these (and any
future additions.)
When we see applications of such methods, we disable adaptation
of argument and return types.
Tested manually with JDK9-ea:
```
Welcome to Scala 2.12.2-20161208-165912-3de1c0c (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea).
Type in expressions for evaluation. Or try :help.
scala> import java.lang.invoke._, scala.runtime.IntRef
import java.lang.invoke._
import scala.runtime.IntRef
scala> val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]);
varHandle: java.lang.invoke.VarHandle = java.lang.invoke.VarHandleInts$FieldInstanceReadWrite@7112ce6
scala> varHandle.getAndSet(ref, 1): Int
res5: Int = 0
scala> varHandle.getAndSet(ref, 1): Int
res6: Int = 1
```
Inspecting bytecode shows the absense of box/unboxing:
```
object Test {
import java.lang.invoke._, scala.runtime.IntRef
val varHandle = MethodHandles.lookup().in(classOf[IntRef]).findVarHandle(classOf[IntRef], "elem", classOf[Int]);
def main(args: Array[String]): Unit = {
val i : Int = varHandle.getAndSet(IntRef.zero, 1)
}
}
```
```
public void main(java.lang.String[]);
Code:
0: aload_0
1: invokevirtual #28 // Method varHandle:()Ljava/lang/invoke/VarHandle;
4: invokestatic #34 // Method scala/runtime/IntRef.zero:()Lscala/runtime/IntRef;
7: iconst_1
8: invokevirtual #40 // Method java/lang/invoke/VarHandle.getAndSet:(Lscala/runtime/IntRef;I)I
11: istore_2
12: return
```
retronym
referenced
this pull request
in retronym/scala
Mar 16, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 4, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 4, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 4, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 4, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 4, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 29, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 29, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
May 29, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
Jul 2, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
Jul 20, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
Aug 6, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
Aug 9, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
Aug 16, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
retronym
referenced
this pull request
in retronym/scala
Aug 16, 2018
Before:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private final int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: return
}
```
The assignment to the final field `foo` has always contravened the JVM spec,
and this rule is enforced for any classfiles of format 53 and higher.
After this patch:
```
scala> trait T { val foo = 24 }; class C extends T
defined trait T
defined class C
scala> :javap -private -c C
Compiled from "<console>"
public class $line3.$read$$iw$$iw$C implements $line3.$read$$iw$$iw$T {
private int foo;
public int foo();
Code:
0: aload_0
1: getfield #21 // Field foo:I
4: ireturn
public void $line3$$read$$iw$$iw$T$_setter_$foo_$eq(int);
Code:
0: aload_0
1: iload_1
2: putfield #21 // Field foo:I
5: return
public $line3.$read$$iw$$iw$C();
Code:
0: aload_0
1: invokespecial #30 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokestatic #34 // InterfaceMethod $line3/$read$$iw$$iw$T.$init$:(L$line3/$read$$iw$$iw$T;)V
8: getstatic #40 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
11: invokevirtual #43 // Method scala/runtime/ScalaRunTime$.releaseFence:()V
14: return
}
```
sjrd
pushed a commit
to sjrd/scala
that referenced
this pull request
Mar 24, 2020
Support classes with nested HK type parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some tests in specialized fail with "value integerBoxCount is not a member of object scala.runtime.BoxesRunTime", but it could also be my old machine I'm currently testing on ...