diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java index 1dd259d0..ccc7b327 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java @@ -114,7 +114,9 @@ public class TypeGenerator { if(referenceTypeContext.classOrInterfaceType() != null){ if(referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType()!= null){ Java8Parser.ClassType_lfno_classOrInterfaceTypeContext ctx = referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType(); - return convertTypeName(ctx.Identifier().toString(), ctx.typeArguments(),referenceTypeContext.getStart(), reg, generics); + //return convertTypeName(ctx.Identifier().toString(), ctx.typeArguments(),referenceTypeContext.getStart(), reg, generics); + if(ctx.typeArguments() != null)throw new NotImplementedException(); + return convertTypeName(referenceTypeContext.getText(), null,referenceTypeContext.getStart(), reg, generics); }else{ throw new NotImplementedException(); } diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java b/src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java index 34501716..3d5fc278 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java @@ -98,9 +98,10 @@ public final class TypeParams implements Iterable{ */ public boolean occurs(PlaceholderType t) { for(UnifyType p : typeParams) - if(p instanceof PlaceholderType) { + if(p instanceof PlaceholderType) {//PL 2018-01-31 dangeling else Problem { ... } eingefuegt. if(p.equals(t)) - return true; } + return true; + } else { if(p.getTypeParams().occurs(t)) return true; } diff --git a/test/javFiles/Faculty.jav b/test/javFiles/Faculty.jav index 50bd7e78..089d2f33 100644 --- a/test/javFiles/Faculty.jav +++ b/test/javFiles/Faculty.jav @@ -6,10 +6,14 @@ class Faculty { return x; } - m () { + Fun1 m () { var fact = (Integer x) -> { return mul(x, fact.apply(x)); }; return fact; } } + +interface Fun1{ + B apply(A a); +} \ No newline at end of file