Add test case for #307
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 2m37s
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 2m37s
This commit is contained in:
parent
606ce8b82d
commit
62f2e05f35
44
resources/bytecode/javFiles/Bug307.jav
Normal file
44
resources/bytecode/javFiles/Bug307.jav
Normal file
@ -0,0 +1,44 @@
|
||||
public class Bug307 {
|
||||
public void main() {
|
||||
IVisitor v = new Visitor();
|
||||
Impl2 f = new Impl2();
|
||||
|
||||
f.accept(v);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -1022,4 +1022,12 @@ public class TestComplete {
|
||||
var clazz = classFiles.get("Bug306");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug307() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug307.jav");
|
||||
var clazz = classFiles.get("Bug307");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
clazz.getDeclaredMethod("main").invoke(instance);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user