modified: ../src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java

modified:   ../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
einige Korrekturen
This commit is contained in:
pl@gohorb.ba-horb.de 2019-12-09 15:54:22 +01:00
parent c68d773486
commit 084b54d295
2 changed files with 9 additions and 3 deletions

View File

@ -123,6 +123,9 @@ public class OutputGenerator implements ASTVisitor{
f.accept(this);
out.append("\n");
}
if (classOrInterface.getfieldInitializations().isPresent()) {//PL 2019-11-28: Zum Ausdrucken der Fieldinitializer
classOrInterface.getfieldInitializations().get().accept(this);
}
for(Method m : classOrInterface.getMethods()){
out.append(tabs);
m.accept(this);

View File

@ -110,7 +110,7 @@ public class TYPEStmt implements StatementVisitor{
for(FieldAssumption fieldAssumption : info.getFields(fieldVar.fieldVarName)){
Constraint constraint = new Constraint();
GenericsResolver resolver = getResolverInstance();
constraint.add(new Pair(fieldVar.receiver.getType(), fieldAssumption.getReceiverType(resolver), PairOperator.EQUALSDOT));
constraint.add(new Pair(fieldVar.receiver.getType(), fieldAssumption.getReceiverType(resolver), PairOperator.SMALLERDOT)); //PL 2019-12-09: SMALLERDOT eingefuegt, EQUALSDOT entfernt, wenn ds Field privat ist muesste es EQUALSDOT lauten
constraint.add(new Pair(
fieldVar.getType(), fieldAssumption.getType(resolver), PairOperator.EQUALSDOT));
oderConstraints.add(constraint);
@ -568,8 +568,11 @@ public class TYPEStmt implements StatementVisitor{
*/
RefTypeOrTPHOrWildcardOrGeneric retType = assumption.getReceiverType(resolver);
methodConstraint.add(new Pair(forMethod.receiver.getType(), retType,
PairOperator.SMALLERDOT));
methodConstraint.add(forMethod.name.equals("apply") ? //PL 2019-11-29: Tenaerer Operator eingefügt, weil bei Lambda-Ausdrücken keine Suntype FunN$$ existiert
new Pair(forMethod.receiver.getType(), retType, PairOperator.EQUALSDOT)
: new Pair(forMethod.receiver.getType(), retType, PairOperator.SMALLERDOT));
methodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(),
PairOperator.EQUALSDOT));
methodConstraint.addAll(generateParameterConstraints(forMethod, assumption, info, resolver));