Merge branch 'bigRefactoring' into unify-Test

This commit is contained in:
Martin Plümicke 2018-02-28 16:10:08 +01:00
commit 15f5a2dc76
3 changed files with 11 additions and 4 deletions

View File

@ -114,7 +114,9 @@ public class TypeGenerator {
if(referenceTypeContext.classOrInterfaceType() != null){ if(referenceTypeContext.classOrInterfaceType() != null){
if(referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType()!= null){ if(referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType()!= null){
Java8Parser.ClassType_lfno_classOrInterfaceTypeContext ctx = referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType(); 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{ }else{
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -98,9 +98,10 @@ public final class TypeParams implements Iterable<UnifyType>{
*/ */
public boolean occurs(PlaceholderType t) { public boolean occurs(PlaceholderType t) {
for(UnifyType p : typeParams) for(UnifyType p : typeParams)
if(p instanceof PlaceholderType) { if(p instanceof PlaceholderType) {//PL 2018-01-31 dangeling else Problem { ... } eingefuegt.
if(p.equals(t)) if(p.equals(t))
return true; } return true;
}
else { else {
if(p.getTypeParams().occurs(t)) if(p.getTypeParams().occurs(t))
return true; } return true; }

View File

@ -6,10 +6,14 @@ class Faculty {
return x; return x;
} }
m () { Fun1<java.lang.Integer,java.lang.Integer> m () {
var fact = (Integer x) -> { var fact = (Integer x) -> {
return mul(x, fact.apply(x)); return mul(x, fact.apply(x));
}; };
return fact; return fact;
} }
} }
interface Fun1<A,B>{
B apply(A a);
}