Using the offline type checker program bmcheck to typecheck an overriding AT EXIT rule causes an NPE if the rule employs the special $! to refer to the return value.
The following rule is an example of one which failed to typecheck.
RULE dump pattern replaced text
CLASS ^TextLineProcessor
METHOD transform(String)
AT EXIT
IF NOT $1.equals($!)
DO System.out.println(" transform(" + $1 + " -> " +$! +")")
ENDRULE
It does appear to typecheck correctly when the agent processes the rule.