diff options
author | Stephan Herrmann | 2012-12-29 13:01:53 +0000 |
---|---|---|
committer | Stephan Herrmann | 2012-12-29 13:51:46 +0000 |
commit | d7f6994db9ce18eec043200a3556d8f15b2a71bf (patch) | |
tree | 15b63a360f9da5703cf0528ad5562e398d4df194 /testplugins | |
parent | f7413877c2f7b5f99b967776c612c9550597df4f (diff) | |
download | org.eclipse.objectteams-d7f6994db9ce18eec043200a3556d8f15b2a71bf.tar.gz org.eclipse.objectteams-d7f6994db9ce18eec043200a3556d8f15b2a71bf.tar.xz org.eclipse.objectteams-d7f6994db9ce18eec043200a3556d8f15b2a71bf.zip |
Bug 397235 - [compiler] cannot bind to a static role method
Diffstat (limited to 'testplugins')
-rw-r--r-- | testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java index c67a1fd0e..bec38e746 100644 --- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java +++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java @@ -2185,6 +2185,74 @@ public class CalloutMethodBinding extends AbstractOTJLDTest { "OK"); } + // Bug 397235 - [compiler] cannot bind to a static role method + // anchored access to static method - static anchor + public void test3113_calloutToStatic5() { + runConformTest(new String[] { + "Team3113cts5_2.java", + "public team class Team3113cts5_2 {\n" + + " final static Team3113cts5_1 other = new Team3113cts5_1();\n" + + " protected class R playedBy R<@other> {\n" + + " void test() -> void test();\n" + + " }\n" + + " void test() {\n" + + " R.test();\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " other.val = \"OK\";\n" + + " new Team3113cts5_2().test();\n" + + " }\n" + + "}\n", + "Team3113cts5_1.java", + "public team class Team3113cts5_1 {\n" + + "public String val;\n" + + "public class R {\n" + + " public static void test() {\n" + + " System.out.print(val);\n" + + " }\n" + + "}\n" + + "public R getR() { return new R(); }\n" + + "}\n" + }, + "OK"); + } + + + // Bug 397235 - [compiler] cannot bind to a static role method + // anchored access to static method - non-static anchor, two segments + public void test3113_calloutToStatic6() { + runConformTest(new String[] { + "Team3113cts6_2.java", + "public team class Team3113cts6_2 {\n" + + " final Team3113cts6_1 other = new Team3113cts6_1();\n" + + " protected class R playedBy R<@other.self> {\n" + + " void test() -> void test();\n" + + " }\n" + + " void test() {\n" + + " R.test();\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " Team3113cts6_2 t = new Team3113cts6_2();" + + " t.other.val = \"OK\";\n" + + " t.test();\n" + + " }\n" + + "}\n", + "Team3113cts6_1.java", + "public team class Team3113cts6_1 {\n" + + " final public Team3113cts6_1 self = this;"+ + " public String val;\n" + + " public class R {\n" + + " public static void test() {\n" + + " System.out.print(val);\n" + + " }\n" + + " }\n" + + " public R getR() { return new R(); }\n" + + "}\n" + }, + "OK"); + } + + // A callout binding creates a role method // 3.1.14-otjld-callout-without-role-method-1 public void test3114_calloutWithoutRoleMethod1() { |