forked from JavaTX/JavaCompilerCore
modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Unterscheidung zwischen FUNN-Receiver und anderem Receiver wieder geloescht (war nur auskmmentiert) modified: ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java Fehler in der Reduce-FUNN-Rege beseitigt
This commit is contained in:
parent
4ef360e41e
commit
9bf273ac1a
@ -520,14 +520,8 @@ public class TYPEStmt implements StatementVisitor{
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
RefTypeOrTPHOrWildcardOrGeneric retType = assumption.getReceiverType(resolver);
|
RefTypeOrTPHOrWildcardOrGeneric retType = assumption.getReceiverType(resolver);
|
||||||
/* if (retType instanceof FunN) {
|
methodConstraint.add(new Pair(forMethod.receiver.getType(), retType,
|
||||||
methodConstraint.add(new Pair(forMethod.receiver.getType(), retType,
|
|
||||||
PairOperator.EQUALSDOT));
|
|
||||||
}
|
|
||||||
else {//RefType */
|
|
||||||
methodConstraint.add(new Pair(forMethod.receiver.getType(), retType,
|
|
||||||
PairOperator.SMALLERDOT));
|
PairOperator.SMALLERDOT));
|
||||||
//}
|
|
||||||
methodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(),
|
methodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(),
|
||||||
PairOperator.EQUALSDOT));
|
PairOperator.EQUALSDOT));
|
||||||
methodConstraint.addAll(generateParameterConstraints(forMethod, assumption, info, resolver));
|
methodConstraint.addAll(generateParameterConstraints(forMethod, assumption, info, resolver));
|
||||||
|
@ -782,10 +782,17 @@ public class RuleSet implements IRuleSet{
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
||||||
Set<UnifyPair> result = new HashSet<UnifyPair>();
|
Set<UnifyPair> result = new HashSet<UnifyPair>();
|
||||||
|
if (pair.getPairOp() == PairOperator.SMALLERDOT) {
|
||||||
result.add(new UnifyPair(funNLhsType.getTypeParams().get(funNLhsType.getTypeParams().size()-1), funNRhsType.getTypeParams().get(funNRhsType.getTypeParams().size()-1), PairOperator.SMALLERDOT, pair.getSubstitution(), pair.getBasePair()));
|
result.add(new UnifyPair(funNLhsType.getTypeParams().get(funNLhsType.getTypeParams().size()-1), funNRhsType.getTypeParams().get(funNRhsType.getTypeParams().size()-1), PairOperator.SMALLERDOT, pair.getSubstitution(), pair.getBasePair()));
|
||||||
for(int i = 0; i < funNLhsType.getTypeParams().size()-1; i++) {
|
for(int i = 0; i < funNLhsType.getTypeParams().size()-1; i++) {
|
||||||
result.add(new UnifyPair(funNRhsType.getTypeParams().get(i), funNLhsType.getTypeParams().get(i), PairOperator.SMALLERDOT, pair.getSubstitution(), pair.getBasePair()));
|
result.add(new UnifyPair(funNRhsType.getTypeParams().get(i), funNLhsType.getTypeParams().get(i), PairOperator.SMALLERDOT, pair.getSubstitution(), pair.getBasePair()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {// pair.getPairOp() == PairOperator.EQUALDOT
|
||||||
|
result.add(new UnifyPair(funNLhsType.getTypeParams().get(funNLhsType.getTypeParams().size()-1), funNRhsType.getTypeParams().get(funNRhsType.getTypeParams().size()-1), PairOperator.EQUALSDOT, pair.getSubstitution(), pair.getBasePair()));
|
||||||
|
for(int i = 0; i < funNLhsType.getTypeParams().size()-1; i++) {
|
||||||
|
result.add(new UnifyPair(funNRhsType.getTypeParams().get(i), funNLhsType.getTypeParams().get(i), PairOperator.EQUALSDOT, pair.getSubstitution(), pair.getBasePair()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result.stream().forEach(x -> { UnifyType l = x.getLhsType();
|
result.stream().forEach(x -> { UnifyType l = x.getLhsType();
|
||||||
if (l instanceof PlaceholderType) { ((PlaceholderType)l).disableWildcardtable(); }
|
if (l instanceof PlaceholderType) { ((PlaceholderType)l).disableWildcardtable(); }
|
||||||
@ -798,7 +805,7 @@ public class RuleSet implements IRuleSet{
|
|||||||
logFile.flush();
|
logFile.flush();
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
System.out.println("lofFile-Error");
|
System.out.println("logFile-Error");
|
||||||
}
|
}
|
||||||
return Optional.of(result);
|
return Optional.of(result);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user