diff --git a/README_aktuelle_Branches b/README_aktuelle_Branches new file mode 100644 index 000000000..faaa8afad --- /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 4ca2ebd6f..644dbaeeb 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 5abacf702..d9ccb66ce 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()) {