From 3deaceec011318c17354d8236ff5e7500c2c6640 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Thu, 8 Mar 2018 01:41:38 +0100 Subject: [PATCH] =?UTF-8?q?UnifyWithoutWildcards=20Test=20l=C3=A4uft=20dur?= =?UTF-8?q?ch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java | 8 ++++---- test/asp/UnifyWithoutWildcards.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java b/src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java index b3534f47..1de833d6 100644 --- a/src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java +++ b/src/de/dhbwstuttgart/sat/asp/parser/ASPParser.java @@ -1,15 +1,12 @@ package de.dhbwstuttgart.sat.asp.parser; import de.dhbwstuttgart.exceptions.DebugException; +import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.parser.scope.JavaClassName; import de.dhbwstuttgart.sat.asp.ASPStringConverter; import de.dhbwstuttgart.sat.asp.model.ASPRule; import de.dhbwstuttgart.sat.asp.parser.model.ParsedType; -import de.dhbwstuttgart.sat.asp.writer.ASPGenerator; -import de.dhbwstuttgart.sat.asp.writer.model.ASPParameterList; -import de.dhbwstuttgart.sat.asp.writer.model.ASPRefType; -import de.dhbwstuttgart.sat.asp.writer.model.ASPType; import de.dhbwstuttgart.syntaxtree.type.*; import de.dhbwstuttgart.typeinference.result.*; @@ -98,6 +95,9 @@ public class ASPParser { RefTypeOrTPHOrWildcardOrGeneric rsType = this.getType(rs); if(lsType instanceof TypePlaceholder && rsType instanceof RefType) return new PairTPHequalRefTypeOrWildcardType((TypePlaceholder) lsType, rsType); + else if(lsType instanceof TypePlaceholder && rsType instanceof TypePlaceholder) + return new PairTPHEqualTPH((TypePlaceholder)lsType, (TypePlaceholder)rsType); + else throw new NotImplementedException(); } return null; } diff --git a/test/asp/UnifyWithoutWildcards.java b/test/asp/UnifyWithoutWildcards.java index e1afc3c8..1b33cbd5 100644 --- a/test/asp/UnifyWithoutWildcards.java +++ b/test/asp/UnifyWithoutWildcards.java @@ -27,10 +27,10 @@ public class UnifyWithoutWildcards { @Test public void adapt() throws InterruptedException, IOException, ClassNotFoundException { ConstraintSet testSet = new ConstraintSet<>(); - List list1 = Arrays.asList(TypePlaceholder.fresh(new NullToken())); + List list1 = Arrays.asList(TypePlaceholder.fresh(new NullToken()),TypePlaceholder.fresh(new NullToken())); List list2 = Arrays.asList(TypePlaceholder.fresh(new NullToken())); RefType t1 = new RefType(new JavaClassName("asp.UnifyWithoutWildcards$Matrix"), list1, new NullToken()); - RefType t2 = new RefType(new JavaClassName("Vector"), list2, new NullToken()); + RefType t2 = new RefType(new JavaClassName("java.util.HashMap"), list2, new NullToken()); testSet.addUndConstraint(new Pair(t1, t2, PairOperator.SMALLERDOT)); ResultSet resultSet = run(testSet); System.out.println(resultSet.results);