forked from JavaTX/JavaCompilerCore
Fehler mit SMALLER und SMALLERDOT behoben
This commit is contained in:
parent
5c12a61699
commit
9e114207ce
@ -360,8 +360,10 @@ public class SourceFile
|
||||
});
|
||||
*/
|
||||
typinferenzLog.debug("\nUnifiziere Constraints:\n"+constraints, Section.TYPEINFERENCE);
|
||||
typinferenzLog.debug("\nFC:\n"+finiteClosure, Section.TYPEINFERENCE);
|
||||
Set<Set<UnifyPair>> unifyResult = new TypeUnify().unify(constraints, finiteClosure);
|
||||
|
||||
typinferenzLog.debug("\nErgebnis der Unifizierung:\n"+unifyResult, Section.TYPEINFERENCE);
|
||||
|
||||
Menge<Menge<Pair>> convertedResult = unifyResult.parallelStream().<Menge<Pair>>map((Set<UnifyPair> resultSet)->{
|
||||
Menge<Pair> innerConvert = resultSet.stream().map((UnifyPair mp)->UnifyTypeFactory.convert(mp))
|
||||
.collect(Menge<Pair>::new, Menge::add, Menge::addAll);
|
||||
@ -373,7 +375,7 @@ public class SourceFile
|
||||
).collect(Menge<Pair>::new, Menge::add, Menge::addAll);
|
||||
|
||||
//Dann den Ergebnissen anfügen
|
||||
typinferenzLog.debug("\nErgebnis der Unifizierung:\n"+unifyResult, Section.TYPEINFERENCE);
|
||||
typinferenzLog.debug("\nErgebnis der Unifizierung (Konvertiert):\n"+convertedResult, Section.TYPEINFERENCE);
|
||||
//result.addAll(convertedResult);
|
||||
|
||||
typinferenzLog.debug("\nJavaFiles:\n", Section.TYPEINFERENCE);
|
||||
|
@ -54,11 +54,15 @@ public class UnifyTypeFactory {
|
||||
}
|
||||
return new FiniteClosure(pairs);
|
||||
}
|
||||
|
||||
|
||||
public static UnifyPair generateSmallerPair(UnifyType tl, UnifyType tr){
|
||||
return new UnifyPair(tl, tr, PairOperator.SMALLER);
|
||||
}
|
||||
|
||||
public static UnifyPair generateSmallerDotPair(UnifyType tl, UnifyType tr){
|
||||
return new UnifyPair(tl, tr, PairOperator.SMALLERDOT);
|
||||
}
|
||||
|
||||
public static UnifyType convert(Type t){
|
||||
//Es wurde versucht ein Typ umzuwandeln, welcher noch nicht von der Factory abgedeckt ist
|
||||
if(t instanceof GenericTypeVar){
|
||||
@ -135,7 +139,7 @@ public class UnifyTypeFactory {
|
||||
|
||||
public static UnifyPair convert(Pair p) {
|
||||
if(!p.OperatorSmaller())throw new NotImplementedException();
|
||||
UnifyPair ret = generateSmallerPair(UnifyTypeFactory.convert(p.TA1)
|
||||
UnifyPair ret = generateSmallerDotPair(UnifyTypeFactory.convert(p.TA1)
|
||||
, UnifyTypeFactory.convert(p.TA2));
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user