FYI, I found the issue, it has nothing to do with the getter's name...
Sorry for the confusion.

The failure was delayed after executing the code causing the issue:

// Groovy4 seems happy with the following line, but not groovy 5 (Class
Cast Exception from String to MethodNode)
//
sceGetDeclaredField.setNodeMetaData(StaticTypesMarker.DIRECT_METHOD_CALL_TARGET,
"getDeclaredField");
// Groovy 5 OK version

sceGetDeclaredField.setNodeMetaData(StaticTypesMarker.DIRECT_METHOD_CALL_TARGET,

 findDeclaredMethod(classNode, "getDeclaredField", 1));
The 2nd arg of setNodeMetaData is "Object" so both versions compile OK ..


Le ven. 17 juil. 2026 à 18:47, Adrien Guichard <[email protected]> a
écrit :

> Thanks, for this quick and simple test-case!
>
> Will have to debug to provide a relevant test-case on my side.
>
> Regards
>
> Le ven. 17 juil. 2026, 17:51, Jochen Theodorou <[email protected]> a
> écrit :
>
>> Hi Adrien,
>>
>> I just tested with this code:
>>
>> class X {
>>    def getFirstName_(){"Adrien"}
>> }
>>
>> assert new X().firstName_ == "Adrien"
>>
>> The assert works, no exception. I think this is not because of Groovy
>> 5.0.7 then
>>
>> bye Jochen
>>
>> On 7/17/26 16:05, Adrien Guichard wrote:
>> > Hello,
>> >
>> >
>> > We are porting our framework to Grails 8.0.0(-M3), which defaults to
>> > Groovy 5.0.7.
>> >
>> > This framework generates getters from an AST Transformation at compile
>> > time. Symbols generated are then used into some DSLs to compose
>> elements
>> > of our apps.
>> >
>> > There is an exception when launching our test app if the name of the
>> > getters ends with an '_'; like in "getFirstName*_*()", if I replace the
>> > '_' with another char, it fails after (missing symbols, because I use
>> > 'someone.firstName_' in the code).
>> >
>> > Is there any restriction regarding the naming conventions for getters
>> in
>> > Groovy 5 ?
>> >
>> > If not, I will dig further and fill an eventual bug report if needed.
>> >
>> >
>> > Regards
>> >
>> > --
>> > Adrien Guichard
>> > + 33 6 10 78 75 88
>> > Taack / Citel / Obsta
>> > 29 Boulevard Edgar Quinet
>> > 75014 Paris
>>
>>

-- 
Adrien Guichard
+ 33 6 10 78 75 88
Taack / Citel / Obsta
29 Boulevard Edgar Quinet
75014 Paris

Reply via email to