Open
Description
when java needs to give access to an inaccessible method, it doesn't change the method itself, but generates a synthetic static accessor that takes the same arguments, plus the this pointer for that method
this scheme makes it easier to stay binary compatible in the presence of changing access patterns, because it doesn't involve making private, non-synthetic, methods public when the need arises for them to be accessible from somewhere
as the static accessor is synthetic, it doesn't affect binary compatibility
This might give us a chance at fixing:
trait A {
def foo: Long
}
object Main {
def a(): A = new A {
var foo: Long = 1000L
val test = () => {
foo = 28
}
}
def main(args: Array[String]) {
println(a().foo)
}
}
which, as reported in #6387 (now marked as a duplicate), gives an AbstractMethodError