*/
public class IntertypeTests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ /**
+ * This is testing that on a secondary compile we can work out what happened in the first compile (where an inner type was
+ * intertyped onto another type). I think we need two conditions to be true for this to pass: <br>
+ * 1) we need an innerclass attribute on the target type <br>
+ * 2) we need the name of the innerclass to match its target rather than the declaring aspect<br>
+ * Line 277 in ClassScope:<br>
+ *
+ * memberTypeBindings[count++] = memberScope.buildType(sourceType, sourceType.fPackage, accessRestriction);<br>
+ * which then: builds the name based on the containing aspect.
+ *
+ * TypeDeclaration.generateCode()
+ *
+ */
+ public void testSeparateCompilation() throws Exception {
+ runTest("separate compilation");
+ }
+
public void testErrorTargettingTypeThatAlreadyHasIt() {
runTest("already has it");
}
<suite>
+ <ajc-test dir="features169/itdInnerTypes/separate" title="separate compilation">
+ <compile files="Basic.java" options="-1.5"/>
+ <compile files="Basic2.java"/>
+ <run class="Basic2">
+ <stdout>
+ <line text="done"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="features169/itdInnerTypes/eleven" title="already has it">
<compile files="Target.java Aspect1.java" options="-1.5">
- <message kind="error" text="target type already declares a member type with the name 'Inner'"/>
+ <message kind="error" text="Duplicate nested type Inner"/>
+ <message kind="error" text="target type already declares a "/>
</compile>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Underscorer$_$choice)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)"/>
</stdout>
</run>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Underscorer$_$choice)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)"/>
</stdout>
</run>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Underscorer$_$choice)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)"/>
</stdout>
</run>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Vote_Amender$_$choice)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)"/>
</stdout>
</run>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Vote_Amender$_$choice)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)"/>
</stdout>
</run>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Vote_Amender$_$choice)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_$choice)"/>
</stdout>
</run>
</ajc-test>
<run class="a.b.c.Runner">
<stdout>
<line text="wibble"/>
- <line text="@a.b.c.RelatedType(value=class a.b.c.Vote_Amender$_)"/>
+ <line text="@a.b.c.RelatedType(value=class a.b.c.Vote$_)"/>
</stdout>
</run>
</ajc-test>