Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.4.7
-
None
-
None
Description
According to the JLS, "A member type declaration in an interface is implicitly static and public", and there does not seem to be any reason for Groovy to support non-static nested classes on interfaces. However, classes not explicitly marked static do not have the static flag set. This appears to be a simple bug in the class generator, as the generated constructor does not attempt to store an outer reference or otherwise behave as an inner class. It does, however, break reflective code (Jackson) that gets very confused when looking for an eligible constructor.
interface Example { class Response { int code } }
Expected result: Example$Response has the static modifier flag set.
Actual result: It does not.
Attachments
Issue Links
- duplicates
-
GROOVY-7312 Compiler generates invalid inner class constructor
- Closed