forked from JavaTX/JavaCompilerCore
Bug 23 gefixt.
This commit is contained in:
parent
f2c7d3b6fa
commit
46291a6056
@ -410,9 +410,10 @@ public class TypeAssumptions {
|
||||
|
||||
public ClassAssumption getClassAssumptionFor(RefType t){
|
||||
for(ClassAssumption cA : this.getClassAssumptions()){
|
||||
if(cA.getAssumedClass().getType().equals(t))return cA;
|
||||
RefType classType = cA.getAssumedClass().getType();
|
||||
if(classType.get_Name().equals(t.get_Name()))return cA;
|
||||
}
|
||||
throw new TypeinferenceException("Der Typ "+t+" ist nicht in den Assumptions vorhanden", t);
|
||||
throw new TypeinferenceException("Die Klasse für den Typ "+t+" ist nicht in den Assumptions vorhanden", t);
|
||||
}
|
||||
|
||||
public Type checkType(RefType type, SyntaxTreeNode parent) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
import java.util.Vector;
|
||||
|
||||
class Matrix extends Menge<Menge<Integer>> {
|
||||
class Matrix extends Vector<Vector<Integer>> {
|
||||
op = (Matrix m) -> (f) -> f.apply(this, m);
|
||||
}
|
4
test/bytecode/Matrix_lambda2.jav
Normal file
4
test/bytecode/Matrix_lambda2.jav
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
class Matrix {
|
||||
op = (f) -> f.apply(2);
|
||||
}
|
14
test/bytecode/Matrix_lambdaTest2.java
Normal file
14
test/bytecode/Matrix_lambdaTest2.java
Normal file
@ -0,0 +1,14 @@
|
||||
package bytecode;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class Matrix_lambdaTest2 {
|
||||
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
|
||||
public final static String testFile = "Matrix_lambda2.jav";
|
||||
public final static String outputFile = "Matrix_lambda2.class";
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user