diff options
author | Stephan Herrmann | 2012-09-22 14:39:46 +0000 |
---|---|---|
committer | Stephan Herrmann | 2012-09-22 14:39:46 +0000 |
commit | 47700cc09e0d3152088b67bbb6920af31adc19d2 (patch) | |
tree | 978e7076c3ca6b895e6680f066c8605a34816ff3 /testplugins | |
parent | 33b594be315d2d641dd3d95841d974a64eb782a9 (diff) | |
download | org.eclipse.objectteams-47700cc09e0d3152088b67bbb6920af31adc19d2.tar.gz org.eclipse.objectteams-47700cc09e0d3152088b67bbb6920af31adc19d2.tar.xz org.eclipse.objectteams-47700cc09e0d3152088b67bbb6920af31adc19d2.zip |
Bug 354480 - VerifyError due to bogus lowering in inferred
callout-to-field
Diffstat (limited to 'testplugins')
-rw-r--r-- | testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java index 42b446d24..8e9e2ed15 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java @@ -19,6 +19,7 @@ import java.util.Map; import junit.framework.Test; +import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.objectteams.otdt.tests.otjld.AbstractOTJLDTest; @@ -3703,4 +3704,63 @@ public class CalloutToField extends AbstractOTJLDTest { "Incompatible types: can\'t convert java.lang.Object[] to java.lang.String[] (OTJLD 3.5(b)).\n" + "----------\n"); } + + // Bug 354480 - VerifyError due to bogus lowering in inferred callout-to-field + public void testBug354480() { + Map options = getCompilerOptions(); + options.put(JavaCore.COMPILER_PB_SUPPRESS_OPTIONAL_ERRORS, JavaCore.ENABLED); + runConformTest( + new String[] { + "Main.java", + "import b.Return;\n" + + "import b.Scope;\n" + + "import t.Team1;\n" + + "public class Main {\n" + + " public static void main(String[] args) {\n" + + " new Team1().activate();\n" + + " new Return().analyse(new Scope());\n" + + " }\n" + + "}\n", + "b/Expr.java", + "package b;\n" + + "public class Expr {\n" + + " public void analyse(Scope scope) {\n" + + " System.out.print(\"OK\");\n" + + " }\n" + + "}\n", + "b/Scope.java", + "package b;\n" + + "public class Scope {}\n", + "b/Return.java", + "package b;\n" + + "public class Return {\n" + + " public Expr expr = new Expr();\n" + + " public void analyse(Scope scope) {\n" + + " }\n" + + "}\n", + "t/Team1.java", + "package t;\n" + + "import b.Expr;\n" + + "import base b.Return;\n" + + "import base b.Scope;\n" + + "\n" + + "public team class Team1 {\n" + + " protected class Scope playedBy Scope {}\n" + + " protected class Return playedBy Return {\n" + + " Expr getExpr() -> get Expr expr;\n" + + " void analyse(Scope scope) <- replace void analyse(Scope scope);\n" + + " @SuppressWarnings({\"inferredcallout\", \"basecall\"})\n" + + " callin void analyse(Scope scope) {\n" + + " this.expr.analyse(scope);\n" + // expr via c-t-f, scope needs lowering + " }\n" + + " }\n" + + "}\n" + }, + "OK", + null/*classLibraries*/, + false/*shouldFlushOutputDirectory*/, + null/*vmArguments*/, + options, + null/*no custom requestor*/); + } } |