Fehler in GTV2TPH behoben

This commit is contained in:
JanUlrich 2014-08-05 18:02:57 +02:00
parent 18b468547d
commit eed860f43e
2 changed files with 7 additions and 1 deletions

View File

@ -219,7 +219,10 @@ public class RefType extends Type implements IMatchable
Vector<Type> paralist = new Vector<Type>();
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);
}

View File

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