From 2eeb54e16aa3fc791b6b202ff3440aa8995e7851 Mon Sep 17 00:00:00 2001 From: Aldaron7 Date: Fri, 16 Mar 2018 22:19:06 +0100 Subject: [PATCH] TypeExpr angepasst bei method und fieldvar um den receiver This erkennen und verarbeiten zu koennen, Typen in Constraints werden mit den inferredTypes abgeleitet --- test/strucType/TestStrucType.java | 13 +++++++------ test/strucType/javFiles/testFieldVar.jav | 4 ++++ test/strucType/javFiles/testMethod.jav | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 test/strucType/javFiles/testMethod.jav diff --git a/test/strucType/TestStrucType.java b/test/strucType/TestStrucType.java index f66ef6c5..388485e3 100644 --- a/test/strucType/TestStrucType.java +++ b/test/strucType/TestStrucType.java @@ -19,12 +19,13 @@ public class TestStrucType { @org.junit.Test public void test() throws ClassNotFoundException, IOException { ArrayList files = new ArrayList<>(); - files.add(new File(rootDirectory + "testLocalVar.jav")); - files.add(new File(rootDirectory + "testCast.jav")); - files.add(new File(rootDirectory + "testNew.jav")); - files.add(new File(rootDirectory + "testFieldVar.jav")); - files.add(new File(rootDirectory + "testFieldMethod.jav")); - files.add(new File(rootDirectory + "testPaperExample.jav")); +// files.add(new File(rootDirectory + "testLocalVar.jav")); +// files.add(new File(rootDirectory + "testCast.jav")); +// files.add(new File(rootDirectory + "testNew.jav")); +// files.add(new File(rootDirectory + "testFieldVar.jav")); +// files.add(new File(rootDirectory + "testFieldMethod.jav")); + files.add(new File(rootDirectory + "testMethod.jav")); +// files.add(new File(rootDirectory + "testPaperExample.jav")); JavaTXCompiler compiler = new JavaTXCompiler(files); for (File f : compiler.sourceFiles.keySet()) { String name = f.getName(); diff --git a/test/strucType/javFiles/testFieldVar.jav b/test/strucType/javFiles/testFieldVar.jav index 7b1d6643..8cf92566 100644 --- a/test/strucType/javFiles/testFieldVar.jav +++ b/test/strucType/javFiles/testFieldVar.jav @@ -1,10 +1,14 @@ package strucType.input; +import strucType.typedtestclasses.A; class F { f; + A a; mF() { return f; } + mA() { return a; } + mX(x) { return x.f; } } \ No newline at end of file diff --git a/test/strucType/javFiles/testMethod.jav b/test/strucType/javFiles/testMethod.jav new file mode 100644 index 00000000..8acb24bd --- /dev/null +++ b/test/strucType/javFiles/testMethod.jav @@ -0,0 +1,14 @@ +package strucType.input; +import strucType.typedtestclasses.A; +import strucType.typedtestclasses.A2; + +class M +{ + mM(x) { return mA(x); } + + A mA(x) { return x.getA(); } + + A2 m(A a) { return a; } + + +} \ No newline at end of file