groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OC <>
Subject Re: looks like a missing exception harness in a typechecker somewhere?
Date Tue, 12 Jul 2016 15:26:35 GMT

On 12. 7. 2016, at 12:43, Jochen Theodorou <> wrote:
> On 11.07.2016 23:26, OC wrote:
>> Hi there,
>> with a pretty complex and heavily AST-transformed code, which, nevertheless, *without
typechecking builds and runs all right*, with a typechecker compilation crashes in the following
way (Groovy 2.4.7).
>> The problem might well be caused by a mistake in my own typechecking extension script
(which, essentially, turns all typechecker errors to warnings); still, though, I think the
compiler should not crash this way (instead, it might report a reasonable error):
> the reasonable error would have been crashing with a BUG exception once you did set the
genericstypes of that ClassNode to null?

I do not think I did that. Definitely the only genericstypes-related thing in my whole project
is one line in my typechecking script, which makes sure the first of genericstypes is used
instead of the classnode itself for lookups, namely,

def lookupMethods(ClassNode cln,String name,argtypes=[]) {
    if (cln==classNodeFor(Class) && cln.isUsingGenerics() && cln.genericsTypes)
cln=cln.genericsTypes[0].type // ugh... got the code from C├ędric!
    ... ... ...

Note that the only things which changes is the local variable cln in there. For reference,
the complete typechecking script (not too intelligible, I am afraid; but short enough, unlike
all those ASTTs etc) is attached at the end of this message.

Thanks and all the best,

View raw message