I don't know why isFunctionalInterface returns true on things that aren't even interfaces but here we go
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 1m0s

This commit is contained in:
Daniel Holle 2024-07-19 18:04:33 +02:00
parent 63493ed0f7
commit ba8810e5df

View File

@ -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;
}