modified: ../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

modified:   ../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
This commit is contained in:
Martin Plümicke 2018-12-14 09:31:58 +01:00
parent 6b33fdc5fb
commit 9dbfbe9e6a
2 changed files with 25 additions and 2 deletions

View File

@ -1144,7 +1144,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
Set<UnifyPair> resultPrime = new HashSet<>();
for(int i = 0; !allGen && i < theta.getTypeParams().size(); i++) {
//if(freshTphs.size()-1 < i)
if(freshTphs.size()-1 < i)//IST DAS RICHTIG??? PL 2018-12-12
freshTphs.add(PlaceholderType.freshPlaceholder());
resultPrime.add(new UnifyPair(freshTphs.get(i), theta.getTypeParams().get(i), PairOperator.SMALLERDOTWC, pair.getSubstitution(), pair));
}

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiFunction;
@ -572,6 +573,28 @@ implements IFiniteClosure {
if ((left instanceof ExtendsType && right instanceof ReferenceType)
|| (right instanceof ExtendsType && left instanceof ReferenceType))
System.out.println("");
/*
List<UnifyType> al = new ArrayList<>();
PlaceholderType xx =new PlaceholderType("xx");
al.add(xx);
left = new ExtendsType(new ReferenceType("Vector", new TypeParams(al)));
right = new ReferenceType("Vector", new TypeParams(new ArrayList<>(al)));
*/
/*
List<UnifyType> al = new ArrayList<>();
PlaceholderType xx =new PlaceholderType("xx");
al.add(xx);
left = new ExtendsType(xx);
right = xx;
*/
/*
List<UnifyType> al = new ArrayList<>();
PlaceholderType xx =new PlaceholderType("xx");
PlaceholderType yy =new PlaceholderType("yy");
al.add(xx);
left = yy;
right = new ExtendsType(xx);
*/
//Die Faelle abfangen, bei den Variablen verglichen werden PL 2018-12-11
UnifyType ex;
if (left instanceof PlaceholderType) {
@ -580,7 +603,7 @@ implements IFiniteClosure {
&& ((PlaceholderType)left).getName().equals(((PlaceholderType)ex).getName())) {// a <.? ? extends a oder a <.? ? super a
return -1;
}
else {// a <. a
else {
return 0;
}
}