Browse Source

check that only abstract aspects can have type parameters, and that a generic super-aspect is fully parameterized in an extends clause.

tags/V1_5_0M3
acolyer 19 years ago
parent
commit
dcb99de449

+ 14
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java View File

@@ -144,6 +144,12 @@ public class AspectDeclaration extends TypeDeclaration {
}
}
}
// check the aspect was not declared generic, only abstract aspects can have type params
if (typeParameters != null && typeParameters.length > 0) {
scope.problemReporter().signalError(sourceStart(), sourceEnd(),
"only abstract aspects can have type parameters");
}
}
if (this.enclosingType != null) {
@@ -185,6 +191,14 @@ public class AspectDeclaration extends TypeDeclaration {
ignoreFurtherInvestigation = true;
return;
}
// if super type is generic, check that we have fully parameterized it
if (superType.isRawType()) {
scope.problemReporter().signalError(sourceStart, sourceEnd,
"a generic super-aspect must be fully parameterized in an extends clause");
ignoreFurtherInvestigation = true;
return;
}
}
}

Loading…
Cancel
Save