From 48964d57add90624a7017a205ba04ac91cb46a63 Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Tue, 25 May 2021 15:32:11 +0200 Subject: [PATCH] 2 new file: README_aktuelle_Branches modified: src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java --- README_aktuelle_Branches | 10 ++++++++++ .../dhbwstuttgart/syntaxtree/type/GenericRefType.java | 7 +++++++ .../typeinference/unify/TypeUnifyTask.java | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 README_aktuelle_Branches diff --git a/README_aktuelle_Branches b/README_aktuelle_Branches new file mode 100644 index 00000000..faaa8afa --- /dev/null +++ b/README_aktuelle_Branches @@ -0,0 +1,10 @@ +Stand: 24.5.21 + bigRefactoring: Master-Brach + bigRefactoringUnifyComment: Dokumentation Unify, Martin + bytecodeGenericsSecond: Generated Generics, Ali, Martin + inferWildcards, Wildcards, Till + master, derzeit nicht genutzt + plugin, eigemntlicher Branch fuer Plugin-Basis, derzeit nicht aktuelle (aktuelle Version in simplifyRes + simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael + strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand + diff --git a/src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java b/src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java index 4ca2ebd6..644dbaee 100644 --- a/src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java +++ b/src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java @@ -38,5 +38,12 @@ public class GenericRefType extends RefTypeOrTPHOrWildcardOrGeneric // TODO Auto-generated method stub return false; } + + + @Override + public String toString() + { + return "GTV " + this.name; + } } diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 5abacf70..d9ccb66c 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -269,6 +269,9 @@ public class TypeUnifyTask extends RecursiveTask>> { System.err.println("no log-File"); } if (isUndefinedPairSetSet(res)) { + //fuer debug-Zwecke + ArrayList al = res.stream().map(x -> x.stream().collect(Collectors.toCollection(ArrayList::new))) + .collect(Collectors.toCollection(ArrayList::new)); throw new TypeinferenceException("Unresolved constraints: " + res.toString(), new NullToken()); //return new HashSet<>(); } else { @@ -2181,6 +2184,12 @@ public class TypeUnifyTask extends RecursiveTask>> { Set> result = new HashSet<>(); + if (thetaPrime instanceof ReferenceType && ((ReferenceType)thetaPrime).isGenTypeVar()) { + Set resultOne = new HashSet<>(); + resultOne.add(new UnifyPair (a, thetaPrime, PairOperator.EQUALSDOT, pair.getSubstitution(), pair)); + result.add(resultOne); + } + boolean allGen = thetaPrime.getTypeParams().size() > 0; for(UnifyType t : thetaPrime.getTypeParams()) if(!(t instanceof PlaceholderType) || !((PlaceholderType) t).isGenerated()) {