JavaCompilerCore/resources/bytecode/javFiles/Bug307.jav

47 lines
711 B
Plaintext
Raw Permalink Normal View History

2024-03-26 10:04:03 +00:00
public class Bug307 {
public void main() {
IVisitor v = new Visitor();
Impl2 f = new Impl2();
2024-03-27 11:21:57 +00:00
Impl1 g = new Impl1();
2024-03-26 10:04:03 +00:00
f.accept(v);
2024-03-27 11:21:57 +00:00
g.accept(v);
2024-03-26 10:04:03 +00:00
}
}
interface IVisitor {
void visit(Impl1 f);
void visit(Impl2 fb);
}
interface IAcceptor {
void accept(IVisitor v);
}
class Visitor implements IVisitor {
@Override
public void visit(Impl1 f) {
}
@Override
public void visit(Impl2 fb) {
}
}
class Impl1 implements IAcceptor {
@Override
public void accept(IVisitor v) {
v.visit(this);
}
}
class Impl2 implements IAcceptor {
@Override
public void accept(IVisitor v) {
v.visit(this);
}
}