-
Enhancement
-
Resolution: Unresolved
-
P4
-
9
Consider the following code:
---
enum Test {
enum Inner { }
}
---
Compiling this produces the following errors:
---
E.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
enum Inner { }
^
(use -source 1.4 or lower to use 'enum' as an identifier)
E.java:2: error: ',', '}', or ';' expected
enum Inner { }
^
E.java:2: error: '}' expected
enum Inner { }
^
3 errors
---
It would be nice if the parser could handle situations like this better.
---
enum Test {
enum Inner { }
}
---
Compiling this produces the following errors:
---
E.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
enum Inner { }
^
(use -source 1.4 or lower to use 'enum' as an identifier)
E.java:2: error: ',', '}', or ';' expected
enum Inner { }
^
E.java:2: error: '}' expected
enum Inner { }
^
3 errors
---
It would be nice if the parser could handle situations like this better.