From 04d3ac84e76f6b1d0fad0ecc4b3f7e44cf72f9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Fri, 15 Jun 2018 16:19:12 +0200 Subject: [PATCH] jeweils apply eingefuegt, was nicht funktioniert modified: ../../test/typeinference/UnifyTest.java Matrix auskommentiert und Lambda einkommentiert --- test/bytecode/javFiles/Faculty.jav | 11 ++++++----- test/bytecode/javFiles/Lambda.jav | 2 +- test/javFiles/Lambda.jav | 2 +- test/typeinference/UnifyTest.java | 6 ++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/bytecode/javFiles/Faculty.jav b/test/bytecode/javFiles/Faculty.jav index cea028c1..a5c649b8 100644 --- a/test/bytecode/javFiles/Faculty.jav +++ b/test/bytecode/javFiles/Faculty.jav @@ -2,14 +2,15 @@ import java.lang.Integer; class Faculty { - Integer mul(Integer x, Integer y) { - return x; - } - m () { var fact = (Integer x) -> { - return mul(x, x); + if (x == 1) { + return x; + } + else { + return x * fact.apply(x-1); + } }; return fact; } diff --git a/test/bytecode/javFiles/Lambda.jav b/test/bytecode/javFiles/Lambda.jav index 3aeded25..de434271 100644 --- a/test/bytecode/javFiles/Lambda.jav +++ b/test/bytecode/javFiles/Lambda.jav @@ -6,6 +6,6 @@ public class Lambda { var lam1 = (Integer x) -> { return x; }; - return lam1; + return lam1.apply(1); } } diff --git a/test/javFiles/Lambda.jav b/test/javFiles/Lambda.jav index 553dc496..02e8b51b 100644 --- a/test/javFiles/Lambda.jav +++ b/test/javFiles/Lambda.jav @@ -7,7 +7,7 @@ public class Lambda { var lam1 = (x) -> { return x; }; - return lam1; + return lam1.apply(1); } } diff --git a/test/typeinference/UnifyTest.java b/test/typeinference/UnifyTest.java index 2a496166..995890ab 100644 --- a/test/typeinference/UnifyTest.java +++ b/test/typeinference/UnifyTest.java @@ -29,12 +29,12 @@ public class UnifyTest { execute(new File(rootDirectory+"fc.jav")); } */ -/* + @Test public void lambda() throws IOException, ClassNotFoundException { execute(new File(rootDirectory+"Lambda.jav")); } -*/ + /* @Test public void lambda2() throws IOException, ClassNotFoundException { @@ -74,6 +74,7 @@ public class UnifyTest { } */ + /* @Test public void matrix() throws IOException, ClassNotFoundException { @@ -81,6 +82,7 @@ public class UnifyTest { //JavaTXCompiler compiler = new JavaTXCompiler(new File(rootDirectory+"Matrix.jav")); //compiler.generateBytecode(); } + */ /* @Test