forked from JavaTX/JavaCompilerCore
modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
modified: src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java Fehler korrigiert in compare
This commit is contained in:
parent
d63c27579c
commit
aa94ce8ad9
@ -576,7 +576,7 @@ public class TYPEStmt implements StatementVisitor{
|
|||||||
methodConstraint.add(new Pair(forMethod.receiver.getType(), retType,
|
methodConstraint.add(new Pair(forMethod.receiver.getType(), retType,
|
||||||
PairOperator.SMALLERDOT));
|
PairOperator.SMALLERDOT));
|
||||||
|
|
||||||
//Fuer Bytecodegenerierung
|
//Fuer Bytecodegenerierung PL 2020-03-09 wird derzeit nicht benutzt
|
||||||
methodConstraint.add(new Pair(forMethod.receiverType, retType,
|
methodConstraint.add(new Pair(forMethod.receiverType, retType,
|
||||||
PairOperator.EQUALSDOT));
|
PairOperator.EQUALSDOT));
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ public class TYPEStmt implements StatementVisitor{
|
|||||||
RefTypeOrTPHOrWildcardOrGeneric assType = assumption.getArgTypes(resolver).get(i);
|
RefTypeOrTPHOrWildcardOrGeneric assType = assumption.getArgTypes(resolver).get(i);
|
||||||
ret.add(new Pair(argType, assType, PairOperator.SMALLERDOT));
|
ret.add(new Pair(argType, assType, PairOperator.SMALLERDOT));
|
||||||
|
|
||||||
//Fuer Bytecodegenerierung
|
//Fuer Bytecodegenerierung PL 2020-03-09 wird derzeit nicht benutzt
|
||||||
ret.add(new Pair(foMethod.argTypes.get(i), assType, PairOperator.EQUALSDOT));
|
ret.add(new Pair(foMethod.argTypes.get(i), assType, PairOperator.EQUALSDOT));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -293,24 +293,25 @@ public class OrderingUnifyPair extends Ordering<Set<UnifyPair>> {
|
|||||||
} else {
|
} else {
|
||||||
if (leftlewc.size() > 0) {
|
if (leftlewc.size() > 0) {
|
||||||
Set<UnifyPair> subst;
|
Set<UnifyPair> subst;
|
||||||
if (leftlewc.iterator().next().getLhsType() instanceof PlaceholderType) {
|
subst = leftlewc.stream().map(x -> {
|
||||||
subst = leftlewc.stream().map(x -> new UnifyPair(x.getLhsType(), x.getRhsType(), PairOperator.EQUALSDOT)).collect(Collectors.toCollection(HashSet::new));
|
if (x.getLhsType() instanceof PlaceholderType) {
|
||||||
}
|
return new UnifyPair(x.getLhsType(), x.getRhsType(), PairOperator.EQUALSDOT);
|
||||||
else {
|
}
|
||||||
subst = leftlewc.stream().map(x -> new UnifyPair(x.getRhsType(), x.getLhsType(), PairOperator.EQUALSDOT)).collect(Collectors.toCollection(HashSet::new));
|
else {
|
||||||
}
|
return new UnifyPair(x.getRhsType(), x.getLhsType(), PairOperator.EQUALSDOT);
|
||||||
|
}}).collect(Collectors.toCollection(HashSet::new));
|
||||||
Unifier uni = new Unifier();
|
Unifier uni = new Unifier();
|
||||||
subst.stream().forEach(x -> uni.add((PlaceholderType) x.getLhsType(), x.getRhsType()));
|
|
||||||
lseq = uni.apply(lseq);
|
lseq = uni.apply(lseq);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Set<UnifyPair> subst;
|
Set<UnifyPair> subst;
|
||||||
if (rightlewc.iterator().next().getLhsType() instanceof PlaceholderType) {
|
subst = rightlewc.stream().map(x -> {
|
||||||
subst = rightlewc.stream().map(x -> new UnifyPair(x.getLhsType(), x.getRhsType(), PairOperator.EQUALSDOT)).collect(Collectors.toCollection(HashSet::new));
|
if (x.getLhsType() instanceof PlaceholderType) {
|
||||||
}
|
return new UnifyPair(x.getLhsType(), x.getRhsType(), PairOperator.EQUALSDOT);
|
||||||
else {
|
}
|
||||||
subst = rightlewc.stream().map(x -> new UnifyPair(x.getRhsType(), x.getLhsType(), PairOperator.EQUALSDOT)).collect(Collectors.toCollection(HashSet::new));
|
else {
|
||||||
}
|
return new UnifyPair(x.getRhsType(), x.getLhsType(), PairOperator.EQUALSDOT);
|
||||||
|
}}).collect(Collectors.toCollection(HashSet::new));
|
||||||
Unifier uni = new Unifier();
|
Unifier uni = new Unifier();
|
||||||
subst.stream().forEach(x -> uni.add((PlaceholderType) x.getLhsType(), x.getRhsType()));
|
subst.stream().forEach(x -> uni.add((PlaceholderType) x.getLhsType(), x.getRhsType()));
|
||||||
rseq = uni.apply(rseq);
|
rseq = uni.apply(rseq);
|
||||||
|
Loading…
Reference in New Issue
Block a user