Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into inferWildcards

This commit is contained in:
JanUlrich 2021-05-25 15:45:32 +02:00
commit c1519783ba
3 changed files with 26 additions and 0 deletions

10
README_aktuelle_Branches Normal file
View File

@ -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

View File

@ -38,5 +38,12 @@ public class GenericRefType extends RefTypeOrTPHOrWildcardOrGeneric
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
@Override
public String toString()
{
return "GTV " + this.name;
}
} }

View File

@ -269,6 +269,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
System.err.println("no log-File"); System.err.println("no log-File");
} }
if (isUndefinedPairSetSet(res)) { 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<>(); throw new TypeinferenceException("Unresolved constraints: " + res.toString(), new NullToken()); //return new HashSet<>();
} }
else { else {
@ -2181,6 +2184,12 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
Set<Set<UnifyPair>> result = new HashSet<>(); Set<Set<UnifyPair>> result = new HashSet<>();
if (thetaPrime instanceof ReferenceType && ((ReferenceType)thetaPrime).isGenTypeVar()) {
Set<UnifyPair> resultOne = new HashSet<>();
resultOne.add(new UnifyPair (a, thetaPrime, PairOperator.EQUALSDOT, pair.getSubstitution(), pair));
result.add(resultOne);
}
boolean allGen = thetaPrime.getTypeParams().size() > 0; boolean allGen = thetaPrime.getTypeParams().size() > 0;
for(UnifyType t : thetaPrime.getTypeParams()) for(UnifyType t : thetaPrime.getTypeParams())
if(!(t instanceof PlaceholderType) || !((PlaceholderType) t).isGenerated()) { if(!(t instanceof PlaceholderType) || !((PlaceholderType) t).isGenerated()) {