From 1667b394f2e85341fe5f299afc262597ab303fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Sun, 11 Mar 2018 20:39:38 +0100 Subject: [PATCH] modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java Variancen gesetzt --- .../typeinference/unify/TypeUnifyTask.java | 12 +++++++----- .../typeinference/unify/model/OrderingUnifyPair.java | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 713ee9aaf..977516b1a 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -572,7 +572,7 @@ public class TypeUnifyTask extends RecursiveTask>> { if(pairOp == PairOperator.SMALLERDOT && lhsType instanceof PlaceholderType) { //System.out.println(pair); if (first) { //writeLog(pair.toString()+"\n"); - Set> x1 = unifyCase1((PlaceholderType) pair.getLhsType(), pair.getRhsType(), pair.getVariance(), fc); + Set> x1 = unifyCase1((PlaceholderType) pair.getLhsType(), pair.getRhsType(), (byte)1, fc); //System.out.println(x1); result.get(0).add(x1); } @@ -588,7 +588,7 @@ public class TypeUnifyTask extends RecursiveTask>> { // Case 2: (a <.? ? ext Theta') else if(pairOp == PairOperator.SMALLERDOTWC && lhsType instanceof PlaceholderType && rhsType instanceof ExtendsType) if (first) { //writeLog(pair.toString()+"\n"); - result.get(1).add(unifyCase2((PlaceholderType) pair.getLhsType(), (ExtendsType) pair.getRhsType(), pair.getVariance(), fc)); + result.get(1).add(unifyCase2((PlaceholderType) pair.getLhsType(), (ExtendsType) pair.getRhsType(), (byte)0, fc)); } else { Set s1 = new HashSet<>(); @@ -601,7 +601,7 @@ public class TypeUnifyTask extends RecursiveTask>> { // Case 3: (a <.? ? sup Theta') else if(pairOp == PairOperator.SMALLERDOTWC && lhsType instanceof PlaceholderType && rhsType instanceof SuperType) if (first) { //writeLog(pair.toString()+"\n"); - result.get(2).add(unifyCase3((PlaceholderType) lhsType, (SuperType) rhsType, pair.getVariance(), fc)); + result.get(2).add(unifyCase3((PlaceholderType) lhsType, (SuperType) rhsType, (byte)0, fc)); } else { Set s1 = new HashSet<>(); @@ -619,7 +619,9 @@ public class TypeUnifyTask extends RecursiveTask>> { // Case 5: (Theta <. a) else if(pairOp == PairOperator.SMALLERDOT && rhsType instanceof PlaceholderType) if (first) { //writeLog(pair.toString()+"\n"); - result.get(4).add(unifyCase5(lhsType, (PlaceholderType) rhsType, pair.getVariance(), fc)); + if (rhsType.getName().equals("A")) + System.out.println(); + result.get(4).add(unifyCase5(lhsType, (PlaceholderType) rhsType, (byte)-1, fc)); } else { Set s1 = new HashSet<>(); @@ -643,7 +645,7 @@ public class TypeUnifyTask extends RecursiveTask>> { else if(pairOp == PairOperator.SMALLERDOTWC && rhsType instanceof PlaceholderType) if (first) { //writeLog(pair.toString()+"\n"); result.get(7).add( - unifyCase8(lhsType, (PlaceholderType) rhsType, pair.getVariance(), fc)); + unifyCase8(lhsType, (PlaceholderType) rhsType, (byte)0, fc)); } else { Set s1 = new HashSet<>(); diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java b/src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java index 8a269ca73..c382cdffa 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java @@ -90,6 +90,7 @@ public class OrderingUnifyPair extends Ordering> { .filter(x -> ((x.getLhsType() instanceof PlaceholderType || x.getRhsType() instanceof PlaceholderType) && x.getPairOp() == PairOperator.SMALLERDOTWC)) .collect(Collectors.toCollection(HashSet::new)); + //System.out.println(left.toString()); //Fall 2 und 3 if (lefteq.size() == 1 && leftle.size() == 1 && righteq.size() == 0 && rightle.size() == 1) { return 1;