Fehler in TYPE beseitigen
This commit is contained in:
parent
d64823ea30
commit
fc6040da39
@ -221,7 +221,7 @@ public class TYPE implements StatementVisitor{
|
||||
protected Constraint<Pair> generateConstraint(MethodCall forMethod, MethodAssumption assumption, TypeInferenceBlockInformation info){
|
||||
Constraint methodConstraint = new Constraint();
|
||||
methodConstraint.add(ConstraintsFactory.createPair(forMethod.receiver.getType(), assumption.getReceiverType(), PairOperator.SMALLERDOT, info));
|
||||
methodConstraint.add(ConstraintsFactory.createPair(assumption.getReturnType(), forMethod.getType(), PairOperator.SMALLERDOT, info));
|
||||
methodConstraint.add(ConstraintsFactory.createPair(assumption.getReturnType(), forMethod.getType(), PairOperator.EQUALSDOT, info));
|
||||
methodConstraint.addAll(generateParameterConstraints(forMethod, assumption, info));
|
||||
return methodConstraint;
|
||||
}
|
||||
@ -229,8 +229,8 @@ public class TYPE implements StatementVisitor{
|
||||
protected Set<Pair> generateParameterConstraints(MethodCall foMethod, MethodAssumption assumption, TypeInferenceBlockInformation info) {
|
||||
Set<Pair> ret = new HashSet<>();
|
||||
for(int i = 0;i<foMethod.arglist.getArguments().size();i++){
|
||||
ret.add(ConstraintsFactory.createPair(assumption.getArgTypes().get(i),
|
||||
foMethod.arglist.getArguments().get(i).getType(), PairOperator.SMALLERDOT, info));
|
||||
ret.add(ConstraintsFactory.createPair(foMethod.arglist.getArguments().get(i).getType(),
|
||||
assumption.getArgTypes().get(i), PairOperator.SMALLERDOT, info));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
class mathStruc<A> {
|
||||
|
||||
mathStruc(A a) { ;}
|
||||
mathStruc(A a) { }
|
||||
|
||||
A model(){ A a; return a; }
|
||||
|
||||
|
@ -30,8 +30,8 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
|
||||
|
||||
@Test
|
||||
public void test() throws IOException, ClassNotFoundException {
|
||||
//filesToTest.add(new File(rootDirectory+"Faculty.jav"));
|
||||
filesToTest.add(new File(rootDirectory+"mathStruc.jav"));
|
||||
filesToTest.add(new File(rootDirectory+"Faculty.jav"));
|
||||
//filesToTest.add(new File(rootDirectory+"mathStruc.jav"));
|
||||
//filesToTest.add(new File(rootDirectory+"Lambda.jav"));
|
||||
//filesToTest.add(new File(rootDirectory+"Lambda2.jav"));
|
||||
//filesToTest.add(new File(rootDirectory+"Lambda3.jav"));
|
||||
|
Loading…
Reference in New Issue
Block a user