diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index c93db4a4..8ea08a23 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -68,7 +68,7 @@ public class JavaTXCompiler { // public static JavaTXCompiler INSTANCE; final CompilationEnvironment environment; - Boolean resultmodel = false; + Boolean resultmodel = true; public final Map sourceFiles = new HashMap<>(); Boolean log = false; //gibt an ob ein Log-File nach System.getProperty("user.dir")+""/logFiles/"" geschrieben werden soll? diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 76e6a438..110886dd 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -2024,7 +2024,15 @@ public class TypeUnifyTask extends RecursiveTask>> { if (((pairOp == PairOperator.SMALLERDOT) || (pairOp == PairOperator.SMALLERNEQDOT)) && lhsType instanceof PlaceholderType) { //System.out.println(pair); if (first) { //writeLog(pair.toString()+"\n"); - Set> x1 = unifyCase1(pair, fc); + Set> x1 = new HashSet<>(); + if (pair.getRhsType().getName().equals("void")) { + Set resultOne = new HashSet<>(); + resultOne.add(new UnifyPair (pair.getLhsType(), pair.getRhsType(), PairOperator.EQUALSDOT, pair.getSubstitution(), pair)); + x1.add(resultOne); + } + else { + x1 = unifyCase1(pair, fc); + } if (pairOp == PairOperator.SMALLERNEQDOT) { Set remElem = new HashSet<>(); remElem.add(new UnifyPair(pair.getLhsType(), pair.getRhsType(), PairOperator.EQUALSDOT)); @@ -2156,7 +2164,15 @@ public class TypeUnifyTask extends RecursiveTask>> { // Case 5: (Theta <. a) else if ((pairOp == PairOperator.SMALLERDOT) && rhsType instanceof PlaceholderType) if (first) { //writeLog(pair.toString()+"\n"); - Set> x1 = unifyCase5(pair, fc); + Set> x1 = new HashSet<>(); + if (pair.getLhsType().getName().equals("void")) { + Set resultOne = new HashSet<>(); + resultOne.add(new UnifyPair (pair.getRhsType(), pair.getLhsType(), PairOperator.EQUALSDOT, pair.getSubstitution(), pair)); + x1.add(resultOne); + } + else { + x1 = unifyCase5(pair, fc); + } result.get(4).add(x1); if (x1.isEmpty()) { undefined.add(pair); //Theta ist nicht im FC diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java index 43c8883d..4e885284 100644 --- a/src/test/java/TestComplete.java +++ b/src/test/java/TestComplete.java @@ -234,6 +234,7 @@ public class TestComplete { } @Test + //@Ignore("This is to complex") public void matrixTest() throws Exception { var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Matrix.jav"); var matrix = classFiles.get("Matrix");