Diagnostic Reference

TRN3003 (unhandled expression type) and TRN3004 (unhandled statement type) mean the compiler encountered a construct it cannot compile. These are defects in rpgc, not in your source. They surface as:

[ERROR] Internal compiler error processing INVCALC.rpgle: TRN3004: Internal error - unhandled
        statement type: ... at ...
        This is a defect in rpgc rather than in the source being compiled; please report it
        together with the source that triggered it.

Unlike every other diagnostic, an internal compiler error carries no source location - the construct that triggered it is not always identifiable. It does carry an internal position, which is the part we need in a report.

An internal error can also arise from an unexpected condition that carries no TRN code of its own. Those name the underlying exception instead:

[ERROR] Internal compiler error processing INVCALC.rpgle: NullPointerException (value null)
        at ... ...

Either way the wording is the same in one respect: it is our defect, not yours. Please do not go looking for the mistake in your source.

If you hit one, please report it - see Reporting a compiler problem - and include the whole message, since the internal position in it is what makes the report actionable. A valid RPG program should never produce one, and each report lets us close a real gap.

Two variants of TRN0002 and TRN0003 also indicate a compiler defect rather than a problem in your source. Their message text says so and asks you to report it.