forked from JavaTX/JavaCompilerCore
modified: resources/bytecode/javFiles/Matrix.jav
modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java modified: src/test/java/targetast/TestComplete.java
This commit is contained in:
parent
02c8dd9804
commit
86d229cac9
@ -1,6 +1,6 @@
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
import java.lang.Float;
|
//import java.lang.Float;
|
||||||
//import java.lang.Byte;
|
//import java.lang.Byte;
|
||||||
//import java.lang.Boolean;
|
//import java.lang.Boolean;
|
||||||
|
|
||||||
|
@ -610,8 +610,8 @@ public class TYPEStmt implements StatementVisitor{
|
|||||||
//Fuer Bytecodegenerierung PL 2020-03-09 wird derzeit nicht benutzt ENDE
|
//Fuer Bytecodegenerierung PL 2020-03-09 wird derzeit nicht benutzt ENDE
|
||||||
|
|
||||||
|
|
||||||
methodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(), PairOperator.EQUALSDOT));
|
methodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(), PairOperator.SMALLERDOT));
|
||||||
extendsMethodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(), PairOperator.EQUALSDOT));
|
extendsMethodConstraint.add(new Pair(assumption.getReturnType(resolver), forMethod.getType(), PairOperator.SMALLERDOT));
|
||||||
|
|
||||||
Set<Pair> parameterContraints = generateParameterConstraints(forMethod, assumption, info, resolver);
|
Set<Pair> parameterContraints = generateParameterConstraints(forMethod, assumption, info, resolver);
|
||||||
|
|
||||||
|
@ -279,6 +279,32 @@ public class TestComplete {
|
|||||||
assertEquals(result, instanceOfClass_m3);
|
assertEquals(result, instanceOfClass_m3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void scalarTest() throws Exception {
|
||||||
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Scalar.jav");
|
||||||
|
var scalar = classFiles.get("Scalar");
|
||||||
|
|
||||||
|
Vector<Vector<Integer>> vv = new Vector<>();
|
||||||
|
Vector<Integer> v1 = new Vector<> ();
|
||||||
|
v1.addElement(2);
|
||||||
|
v1.addElement(2);
|
||||||
|
|
||||||
|
var instanceOfClass_s1 = scalar.getDeclaredConstructor(Vector.class).newInstance(v1);
|
||||||
|
|
||||||
|
Vector<Integer> v2 = new Vector<> ();
|
||||||
|
v2.addElement(2);
|
||||||
|
v2.addElement(2);
|
||||||
|
|
||||||
|
var instanceOfClass_s2 = scalar.getDeclaredConstructor(Vector.class).newInstance(v2);
|
||||||
|
|
||||||
|
var mul = scalar.getDeclaredMethod("mul", Vector.class);
|
||||||
|
var result = mul.invoke(instanceOfClass_s1, instanceOfClass_s2);
|
||||||
|
System.out.println(instanceOfClass_s1.toString() + " * " + instanceOfClass_s2.toString() + " = " + result.toString());
|
||||||
|
|
||||||
|
assertEquals(result, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void mergeTest() throws Exception {
|
public void mergeTest() throws Exception {
|
||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Merge.jav");
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Merge.jav");
|
||||||
|
Loading…
Reference in New Issue
Block a user