modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java

modified:   src/test/resources/bytecode/javFiles/OL.jav
This commit is contained in:
pl@gohorb.ba-horb.de 2019-12-23 11:25:07 +01:00
parent 09a6aec65d
commit 4391adfb0f
2 changed files with 7 additions and 3 deletions

View File

@ -666,8 +666,11 @@ public class TYPEStmt implements StatementVisitor{
protected Constraint<Pair> generateConstructorConstraint(NewClass forConstructor, MethodAssumption assumption, protected Constraint<Pair> generateConstructorConstraint(NewClass forConstructor, MethodAssumption assumption,
TypeInferenceBlockInformation info, GenericsResolver resolver){ TypeInferenceBlockInformation info, GenericsResolver resolver){
Constraint methodConstraint = new Constraint(); Constraint methodConstraint = new Constraint();
//WELCHEN SINN MACHT DIESER CONSTRAINT???
//Ist er nicht immer classname <. classname und damit redundant?
methodConstraint.add(new Pair(assumption.getReturnType(resolver), forConstructor.getType(), methodConstraint.add(new Pair(assumption.getReturnType(resolver), forConstructor.getType(),
PairOperator.SMALLERDOT)); PairOperator.SMALLERDOT));
//WELCHEN SINN MACHT DIESER CONSTRAINT???
methodConstraint.addAll(generateParameterConstraints(forConstructor, assumption, info, resolver)); methodConstraint.addAll(generateParameterConstraints(forConstructor, assumption, info, resolver));
return methodConstraint; return methodConstraint;
} }

View File

@ -7,9 +7,10 @@ import java.lang.Boolean;
public class OL { public class OL {
m(x) { return x + x; } java.lang.Double m(java.lang.Double x) { return x + x; }
java.lang.Integer m(java.lang.Integer x) { return x + x; }
m(Boolean x) { return x; } java.lang.String m(java.lang.String x) { return x + x; }
java.lang.Boolean m(Boolean x) { return x; }
// if the class contains just this method, then correct BC will be generated. // if the class contains just this method, then correct BC will be generated.
// But if another methods are contained then the generated BC is not correct // But if another methods are contained then the generated BC is not correct