From eed860f43e45897950d0885c598cc9344cff2504 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Tue, 5 Aug 2014 18:02:57 +0200 Subject: [PATCH] Fehler in GTV2TPH behoben --- src/mycompiler/mytype/RefType.java | 5 ++++- src/typinferenz/SingleConstraint.java | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) 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); }