diff --git a/src/mycompiler/mytype/RefType.java b/src/mycompiler/mytype/RefType.java index 9e1ec0c2..72810d73 100755 --- a/src/mycompiler/mytype/RefType.java +++ b/src/mycompiler/mytype/RefType.java @@ -219,7 +219,10 @@ public class RefType extends Type implements IMatchable Vector paralist = new Vector(); if(this.get_ParaList()!=null)for(Type t : this.get_ParaList()){ if(t instanceof GenericTypeVar)paralist.add(((GenericTypeVar)t).getTypePlaceHolder()); - else paralist.add(t); + else{ + if(t instanceof RefType)((RefType) t).GTV2TPH(); + paralist.add(t); + } } this.set_ParaList(paralist); } diff --git a/src/typinferenz/SingleConstraint.java b/src/typinferenz/SingleConstraint.java index 431f2da6..12d35320 100755 --- a/src/typinferenz/SingleConstraint.java +++ b/src/typinferenz/SingleConstraint.java @@ -66,6 +66,9 @@ public class SingleConstraint extends UndConstraint{ //{//Wenn die beiden übergebenen Typen weder RefTypes noch TypePlaceholder sind: // throw new TypinferenzException("Ein Constraint darf nur aus TypePlaceholdern und Reftypes bestehen"); //} + if(!(p1 instanceof RefType) && !(p1 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); + if(!(p2 instanceof RefType) && !(p2 instanceof TypePlaceholder))throw new DebugException("Fehler: "+p2+" kann nicht in TPH oder RefType umgewandelt werden"); + constraintPair = new Pair(p1,p2); }