turn refs to super: process anonymous classes; infer type parameters

This commit is contained in:
anna
2010-02-08 21:23:09 +03:00
parent b0440edeca
commit 465bb913a9
6 changed files with 115 additions and 3 deletions
@@ -0,0 +1,20 @@
interface Intf {
}
interface Factory<E extends Intf> {
E create();
void save(E obj);
static class helper {
static Factory<Intf> get2() {
return (Factory)new Factory<Intf>() {
public Intf create() { return null; }
public void save(Intf obj) { }
};
}
}
}
public class Clazz implements Intf {
}
@@ -0,0 +1,20 @@
interface Intf {
}
interface Factory<E extends Intf> {
E create();
void save(E obj);
static class helper {
static Factory<Intf> get2() {
return (Factory)new Factory<Clazz>() {
public Clazz create() { return null; }
public void save(Clazz obj) { }
};
}
}
}
public class Clazz implements Intf {
}
@@ -0,0 +1,22 @@
interface Intf {
}
interface Factory<E extends Intf> {
E create();
void save(E obj);
static class helper {
static Factory<Intf> get() {
return null;
}
}
}
public class Clazz implements Intf {
void bar() {
Intf y = Factory.helper.get().create();
Factory.helper.get().save(y);
}
}
@@ -0,0 +1,22 @@
interface Intf {
}
interface Factory<E extends Intf> {
E create();
void save(E obj);
static class helper {
static Factory<Intf> get() {
return null;
}
}
}
public class Clazz implements Intf {
void bar() {
Clazz y = Factory.helper.get().create();
Factory.helper.get().save(y);
}
}