2002-12-16 19:51:06 +01:00
|
|
|
|
|
|
|
/** @testcase expect CE for declaration collision between subaspects instead of domination order */
|
|
|
|
public class DeclarationCollisionCE {
|
|
|
|
public static void main (String[] args) {
|
|
|
|
C s = new C();
|
|
|
|
System.err.println("title: " + s.title());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C {}
|
|
|
|
|
|
|
|
// bug: dominates clause prevents collision error
|
2002-12-30 20:18:26 +01:00
|
|
|
abstract aspect AA { declare dominates: AA, B;
|
2002-12-16 19:51:06 +01:00
|
|
|
// same result if this line is uncommented
|
|
|
|
//public String C.title() { return "[AA] C.title()"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
aspect A extends AA { // implicitly dominates AA
|
|
|
|
// dominates AA's declaration, overriding Super.title
|
2002-12-30 20:18:26 +01:00
|
|
|
public String C.title() { // CE 20 collision with B declaration
|
2002-12-16 19:51:06 +01:00
|
|
|
return "[A] C.title()" ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
aspect B extends AA { // explicitly dominated by AA ?? --> and hence by A??
|
|
|
|
// B fails to dominate AA's declaration, overriding Super.title
|
2002-12-30 20:18:26 +01:00
|
|
|
public String C.title() { // CE 27 collision with A declaration
|
2002-12-16 19:51:06 +01:00
|
|
|
return "[B] C.title()" ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|