You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ dotc Anon.scala
$ javap Car Volvo 'Car$$anon$1'
Compiled from "Anon.scala"
public class Car {
public static Car car();
public Car();
}
Compiled from "Anon.scala"
public final class Volvo extends Car {
public Volvo();
}
Compiled from "Anon.scala"
class Car$$anon$1 extends Car {
public Car$$anon$1();
}
scalac instead yields this:
$ scalac Anon.scala
$ javap Car Volvo 'Car$$anon$1'
Compiled from "Anon.scala"
public class Car {
public static Car car();
public Car();
}
Compiled from "Anon.scala"
public final class Volvo extends Car {
public Volvo();
}
Compiled from "Anon.scala"
public final class Car$$anon$1 extends Car {
public Car$$anon$1();
}
The text was updated successfully, but these errors were encountered:
smarter
changed the title
Anonymous classes are not final.
Final local classes are emitted as non-local
Apr 28, 2018
It seems like the flags of Anonymous classes are somehow lost during compilation. Despite these lines in Typer.scala:
Anonymous classes are compiled without the
public final
.Compiling this:
with dotc yields this:
scalac instead yields this:
The text was updated successfully, but these errors were encountered: