diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java index e318f737..036dba9c 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java @@ -906,6 +906,7 @@ public class RuleSet implements IRuleSet{ var fiArgs = fc.getFunctionalInterfaceTypeArguments(refType); var retType = fiArgs.getFirst(); + System.out.println(lhsType.getName()); var lhsArgs = fc.getFunctionalInterfaceTypeArguments(lhsType); var lhsRet = lhsArgs.getFirst(); diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java index 0dd832ac..99caa0b3 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java @@ -613,6 +613,8 @@ implements IFiniteClosure { @Override public List getFunctionalInterfaceTypeArguments(UnifyType t) { + if (t instanceof FunNType) return Arrays.asList(t.getTypeParams().get()).reversed(); + var clazz = compiler.getClass(new JavaClassName(t.getName())); var intfMethod = clazz.getMethods().stream().filter(m -> Modifier.isAbstract(m.modifier)).findFirst().orElseThrow(); @@ -630,7 +632,6 @@ implements IFiniteClosure { i += 1; } - System.out.println(args); return args; }