from jacks test 9.2-implicit-4
With 4668238 fixed, the following is accepted by the compiler. But
it will not verify. JLS 9.2 need to add an additional restriction
on what methods from Object are inherited, something like
"... unless m is not final and ..."
I have twisted Gilad's arm into penciling that into his draft of JLS3.
interface I {
Class getClass();
static class T {
static void f(I i) {
if (i == null) {
Integer x = new Integer(2);
} else {
I x = i;
x.getClass();
}
}
public static void main(String[] args) {
f(null);
}
}
}
With 4668238 fixed, the following is accepted by the compiler. But
it will not verify. JLS 9.2 need to add an additional restriction
on what methods from Object are inherited, something like
"... unless m is not final and ..."
I have twisted Gilad's arm into penciling that into his draft of JLS3.
interface I {
Class getClass();
static class T {
static void f(I i) {
if (i == null) {
Integer x = new Integer(2);
} else {
I x = i;
x.getClass();
}
}
public static void main(String[] args) {
f(null);
}
}
}