Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-02-10 17:57:27 +0000
committerStephan Herrmann2013-02-10 18:02:42 +0000
commit46b5d51c9d08356f7eef34466c9a9ba54bcb8050 (patch)
treec5f3ed51ae0d1293b92b2acb7d3f7441da2f843e /testplugins
parentc781c767a0c6759204546599f1a23ee389585276 (diff)
downloadorg.eclipse.objectteams-46b5d51c9d08356f7eef34466c9a9ba54bcb8050.tar.gz
org.eclipse.objectteams-46b5d51c9d08356f7eef34466c9a9ba54bcb8050.tar.xz
org.eclipse.objectteams-46b5d51c9d08356f7eef34466c9a9ba54bcb8050.zip
Bug 400404 - [compiler] No enclosing instance of the type TOuter.T1 is
accessible in scope - layered team and inheritance
Diffstat (limited to 'testplugins')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java50
1 files changed, 48 insertions, 2 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java
index ec1d96fed..a719ed26b 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/rolesandteams/TeamNesting.java
@@ -1,13 +1,12 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
- * Copyright 2010 Stephan Herrmann
+ * Copyright 2010, 2013 Stephan Herrmann
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id$
*
* Please visit http://www.eclipse.org/objectteams for updates and contact.
*
@@ -2253,6 +2252,53 @@ public class TeamNesting extends AbstractOTJLDTest {
"OK");
}
+ // Bug 400404 - [compiler] No enclosing instance of the type TOuter.T1 is accessible in scope - layered team and inheritance
+ public void test1122_layerdTeams9() {
+ runConformTest(
+ new String[] {
+ "Team1122lt9_2.java",
+ "\n" +
+ "public team class Team1122lt9_2 {\n" +
+ " public team class T1 {\n" +
+ " protected final Team1122lt9_1 thatTeam = new Team1122lt9_1();\n" +
+ " protected class R playedBy R1<@thatTeam> {" +
+ " @SuppressWarnings(\"basecall\")\n" +
+ " callin String fixedToString() {\n" +
+ " return \"OK\";\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " public team class T2 extends T1 {\n" +
+ " @Override protected class R {\n" +
+ " String fixedToString() <- replace String toString();\n" +
+ " }\n" +
+ " }\n" +
+ " void test() {\n" +
+ " T2 t = new T2();\n" +
+ " t.activate();\n" +
+ " System.out.print(t.thatTeam.getR1(\"NOTOK\"));\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " new Team1122lt9_2().test();\n" +
+ " }\n" +
+ "}\n" +
+ " \n",
+ "Team1122lt9_1.java",
+ "\n" +
+ "public team class Team1122lt9_1 {\n" +
+ " public class R1 {\n" +
+ " String val;\n" +
+ " public R1(String v) { this.val = v; }\n" +
+ " @Override\n" +
+ " public String toString() { return val; }\n" +
+ " }\n" +
+ " public R1 getR1(String v) { return new R1(v); }\n" +
+ "}\n" +
+ " \n"
+ },
+ "OK");
+ }
+
// a nested team is played by a regular class, its (inner) role by an inner of the base - (we had a problem with splitting creation methods in conjunction with base class decapsulation )
// 1.1.23-otjld-team-layered-on-regular-nested-1
public void test1123_teamLayeredOnRegularNested1() {

Back to the top