]> source.dussan.org Git - aspectj.git/commitdiff
check that only abstract aspects can have type parameters, and that a generic super...
authoracolyer <acolyer>
Thu, 11 Aug 2005 10:37:26 +0000 (10:37 +0000)
committeracolyer <acolyer>
Thu, 11 Aug 2005 10:37:26 +0000 (10:37 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java

index ac88e4a0711f40c49f743f806bd87c73746121f5..1b0d3eaea8d9eb8d418d00860830757dd88db1a4 100644 (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;
+                       }
                }
        }