diff --git a/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java b/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java index 77d1460c..d5b11caa 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java @@ -305,8 +305,11 @@ public class Codegen { private boolean isFunctionalInterface(TargetType type) { if (type instanceof TargetFunNType) return true; - if (type instanceof TargetRefType) - return compiler.getClass(new JavaClassName(type.name())).isFunctionalInterface(); + if (type instanceof TargetRefType) { + var clazz = compiler.getClass(new JavaClassName(type.name())); + return (clazz.getModifiers() & Modifier.INTERFACE) != 0 && clazz.isFunctionalInterface(); + } + return false; }