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