files="Test_AroundVarBug.java,AroundVarBug.java"/>
<run class="Test_AroundVarBug"/>
</ajc-test>
-
- <ajc-test dir="bugs150" pr="83645"
- title="pertypewithin on interface">
- <compile files="PR83645.java"/>
- <run class="PR83645"/>
- </ajc-test>
</suite>
public class PR83645 implements IP {
public static void main(String[] args) {
try {
+ boolean hasAspect = PT.hasAspect(IP.class);
+ if (hasAspect) throw new Error("Shouldn't have an instance for an interface");
boolean yes = (PT.aspectOf(IP.class) instanceof PT);
throw new Error("expected NoAspectBoundException, got instance?: " + yes);
} catch (NoAspectBoundException e) {
}
}
}
+
aspect PT pertypewithin(IP+) {
static int INDEX;
final int index = INDEX++;
- public PT() {
- }
+
+ public PT() {}
+
public String toString() {
return "me " + index;
}
public void testPerTypeWithinMissesNamedInnerTypes() {
CompilationResult cR = ajc(baseDir,new String[]{"PR83563_1.java"});
- assertTrue("Should be no errors:"+cR,!cR.hasErrorMessages());
+ assertMessages(cR,new EmptyMessageSpec());
RunResult rR = run("PR83563_1");
}
public void testPerTypeWithinMissesAnonymousInnerTypes() {
CompilationResult cR = ajc(baseDir,new String[]{"PR83563_2.java"});
- assertTrue("Should be no errors:"+cR,!cR.hasErrorMessages());
+ assertMessages(cR,new EmptyMessageSpec());
RunResult rR = run("PR83563_2");
}
+
+ public void testPerTypeWithinIncorrectlyMatchingInterfaces() {
+ CompilationResult cR = ajc(baseDir,new String[]{"PR83645.java"});
+ assertMessages(cR,new EmptyMessageSpec());
+ RunResult rR = run("PR83645");
+ }
}
\ No newline at end of file