From 9dbfbe9e6a10b862718640e23dcc9f8438f09273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Fri, 14 Dec 2018 09:31:58 +0100 Subject: [PATCH] modified: ../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java modified: ../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java --- .../typeinference/unify/TypeUnifyTask.java | 2 +- .../unify/model/FiniteClosure.java | 25 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 7a61eab2..fc8300c8 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -1144,7 +1144,7 @@ public class TypeUnifyTask extends RecursiveTask>> { Set 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)); } diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java b/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java index ee206fb7..4aa769e5 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java @@ -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 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 al = new ArrayList<>(); + PlaceholderType xx =new PlaceholderType("xx"); + al.add(xx); + left = new ExtendsType(xx); + right = xx; + */ + /* + List 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; } }