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
specialize anonymous classes inside specialized methods #3457
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3457?orig=1 |
@soc said: Classes emitted: bug$$A$$mcI$$sp$$$$anon$$2.class bug$$B$$mcI$$sp.class
bug$$A$$mcI$$sp.class bug$$B$$mcI$$sp$$class.class
bug$$A$$$$anon$$1.class bug$$B.class bug.class
bug$$A.class bug$$B$$class.class bug$$.class javap -c 'bug$$A$$$$anon$$1' Compiled from "bug.scala"
public final class bug$$A$$$$anon$$1 extends java.lang.Object implements bug$$B{
public int value$$mcI$$sp();
Code:
0: aload_0
1: invokestatic SI-13; //Method bug$$B$$class.value$$mcI$$sp:(Lbug$$B;)I
4: ireturn
public java.lang.Object value();
Code:
0: aload_0
1: getfield SI-19; //Field $$outer:Lbug$$A;
4: getfield SI-25; //Field bug$$A.x:Ljava/lang/Object;
7: areturn
public bug$$A$$$$anon$$1(bug$$A);
Code:
0: aload_1
1: ifnonnull 12
4: new SI-31; //class java/lang/NullPointerException
7: dup
8: invokespecial SI-34; //Method java/lang/NullPointerException."<init>":()V
11: athrow
12: aload_0
13: aload_1
14: putfield SI-19; //Field $$outer:Lbug$$A;
17: aload_0
18: invokespecial SI-37; //Method java/lang/Object."<init>":()V
21: aload_0
22: invokestatic SI-41; //Method bug$$B$$class.$$init$$:(Lbug$$B;)V
25: return
} javap -c 'bug$$A$$mcI$$sp' Compiled from "bug.scala"
public class bug$$A$$mcI$$sp extends bug$$A{
public final int x$$mcI$$sp;
public bug$$B foo();
Code:
0: aload_0
1: invokevirtual SI-13; //Method foo$$mcI$$sp:()Lbug$$B;
4: areturn
public bug$$B foo$$mcI$$sp();
Code:
0: new SI-17; //class bug$$A$$mcI$$sp$$$$anon$$2
3: dup
4: aload_0
5: invokespecial SI-21; //Method bug$$A$$mcI$$sp$$$$anon$$2."<init>":(Lbug$$A$$mcI$$sp;)V
8: areturn
public bug$$A$$mcI$$sp(int);
Code:
0: aload_0
1: iload_1
2: putfield SI-24; //Field x$$mcI$$sp:I
5: aload_0
6: iload_1
7: invokestatic SI-30; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
10: invokespecial SI-35; //Method bug$$A."<init>":(Ljava/lang/Object;)V
13: return
} javap -c 'bug$$A$$mcI$$sp$$$$anon$$2' Compiled from "bug.scala"
public final class bug$$A$$mcI$$sp$$$$anon$$2 extends java.lang.Object implements bug$$B{
public int value$$mcI$$sp();
Code:
0: aload_0
1: invokestatic SI-13; //Method bug$$B$$class.value$$mcI$$sp:(Lbug$$B;)I
4: ireturn
public int value();
Code:
0: aload_0
1: getfield SI-18; //Field $$outer:Lbug$$A$$mcI$$sp;
4: getfield SI-24; //Field bug$$A$$mcI$$sp.x$$mcI$$sp:I
7: ireturn
public java.lang.Object value();
Code:
0: aload_0
1: invokevirtual SI-27; //Method value:()I
4: invokestatic SI-33; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
7: areturn
public bug$$A$$mcI$$sp$$$$anon$$2(bug$$A$$mcI$$sp);
Code:
0: aload_1
1: ifnonnull 12
4: new SI-37; //class java/lang/NullPointerException
7: dup
8: invokespecial SI-40; //Method java/lang/NullPointerException."<init>":()V
11: athrow
12: aload_0
13: aload_1
14: putfield SI-18; //Field $$outer:Lbug$$A$$mcI$$sp;
17: aload_0
18: invokespecial SI-43; //Method java/lang/Object."<init>":()V
21: aload_0
22: invokestatic SI-47; //Method bug$$B$$class.$$init$$:(Lbug$$B;)V
25: return
} Did this specialize it as expected? |
@non said: Could we either close this bug, or get an updated problem statement (i.e. a program whose output is wrong)? |
@paulp said: |
There is no
value$$int
inA$$Int.foo$$int
.The text was updated successfully, but these errors were encountered: