Community
Participate
Working Groups
200411300800: The documentation states that a TypeDeclarationStatement in JLS3 wraps the following nodes: - TypeDeclaration - EnumDeclaration - AnnotationTypeDeclaration The final draft of the language specification obtained at jcp.org however states the following rule: BlockStatement:=LocalVariableDeclarationStatement|ClassDeclaration|Statement Enums and Annotations are not allowed as local types.
Jim, can you handle this? We might consider this a syntactically possible. so we need to find out if we can allow this.
ClassDeclaration includes EnumDeclaration, according to JLS3 8.1. So the only ones that are not legal are interface and @interface. Syntactically, we should probably try to parse these but mark as malformed. I'll update the spec.
Changed comment to read: * For JLS3, the kinds of type declarations grew to include enum declarations: * <pre> * TypeDeclarationStatement: * TypeDeclaration * EnumDeclaration * </pre> * Although allowed at the AST, not all arrangements of AST nodes are meaningful; * in particular, only class and enum declarations are meaningful in the context of * a block.
Verified in 200412140800