You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by "ocs@ocs.cz" <oc...@ocs.cz> on 2022/09/08 15:55:41 UTC

G4 woes: CastExpression cannot change type :(

Hell. Another G4 problem, which breaks my ASTTs very nicely, is that CastExpression forbids type change now. Why, on earth? Looks like a commit 57559e53e7219bba114cef07a47d84f72b131875 of 26 Sep 2020, commented as “prevent typecast expression with null type”

I could well understand something like e.g.

    public void setType(final ClassNode type) {
        if (type) super.setType(type);
        else throw new UnsupportedOperationException();
    }

or something similar, but the hard-coded exception is really bad :(