Help with traits compilation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Help with traits compilation

Milles, Eric (TR Tech, Content & Ops)
Groovy devs,

When is compiled, it produces the following class files in the build directory:

However, the javap output of the class tells a different story with regards to inner types:
    SourceFile: "ServiceUnitTest.groovy"
         public static abstract #19= #18 of #2; //Helper=class grails/testing/services/ServiceUnitTest$Trait$Helper of class grails/testing/services/ServiceUnitTest
         public static #22= #21 of #2; //FieldHelper=class grails/testing/services/ServiceUnitTest$Trait$FieldHelper of class grails/testing/services/ServiceUnitTest
         static #25= #24 of #2; //1=class grails/testing/services/ServiceUnitTest$Trait$FieldHelper$1 of class grails/testing/services/ServiceUnitTest

It is this last type -- ServiceUnitTest$Trait$FieldHelper$1 -- that cannot be resolved.  Can someone familiar with traits compilation say if this class belongs in the bytecode and therefore should also be one of the output class files?  Or if this is an errant entry in the class file?  When the Compiler/IDE tries to resolve the type, it of course gets an error since it is missing.

Eric M.