-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
object Foo {
def foo[X <: Int](x: X) = {
def bar = "a"
bar
}
def foo(x: String) = {
def bar = 2
bar
}
}
if we use sbt 'run Foo.scala'; javap -p Foo$
I get:
public final class Foo$ {
public static final Foo$ MODULE$;
public static {};
public Foo$();
public java.lang.String foo(int);
public int foo(java.lang.String);
private java.lang.String bar$1();
private int bar$2();
}
but if we do dotc Foo.scala; javap -p Foo$
I get:
public final class Foo$ {
public static final Foo$ MODULE$;
public static {};
public Foo$();
public java.lang.String foo(int);
public int foo(java.lang.String);
private java.lang.String bar$2();
private int bar$1();
}
Note that the names bar$1
and bar$2
are inverted. This is not incorrect but might not be good for the incremental compilation as it can invalidates based on class files that have not really changed.