--- /dev/null
+public aspect pr105479 {
+ private interface Test {
+ Object getId();
+ }
+
+ class StringTest {
+ public String getId() {
+ return null;
+ }
+ }
+
+ declare parents : StringTest implements Test;
+}
\ No newline at end of file
runTest("inner type of generic interface reference from parameterized type");
}
+ public void testDeclareParentsIntroducingCovariantReturnType() {
+ runTest("declare parents introducing override with covariance");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
<ajc-test dir="bugs150" pr="95992" title="inner type of generic interface reference from parameterized type">
<compile files="pr95992.aj" options="-1.5"/>
</ajc-test>
-
+
+ <ajc-test dir="bugs150" pr="105479" title="declare parents introducing override with covariance">
+ <compile files="pr105479.aj" options="-1.5"/>
+ </ajc-test>
<!-- ============================================================================ -->
<!-- ============================================================================ -->
// Allow for covariance - wish I could test this (need Java5...)
ResolvedType subType = weaver.getWorld().resolve(subMethod.getReturnType());
ResolvedType superType = weaver.getWorld().resolve(superMethod.getReturnType());
- if (!subType.isAssignableFrom(superType)) {
+ if (!superType.isAssignableFrom(subType)) {
ISourceLocation sloc = subMethod.getSourceLocation();
weaver.getWorld().getMessageHandler().handleMessage(MessageUtil.error(
"The return type is incompatible with "+superMethod.getDeclaringType()+"."+superMethod.getName()+superMethod.getParameterSignature(),