ascot diagnostics

A4476

Warning: Output formal argument ‘{name}’ is never assigned

An Output parameter no path of the body assigns. The caller passes a variable to receive a value and gets none, so its first read of the variable raises <UNDEFINED>; IRIS compiles the method all the same, since Output only documents intent. Assign the parameter on every path, or take it out of the signature.

IRIS compiles the example, and do ##class(Demo.OutputNeverAssigned).Double(5, .result) write result raises <UNDEFINED> when it runs.

Class Demo.OutputNeverAssigned
{

ClassMethod Double(value As %Integer, Output result As %Integer) As %Integer //! A4476
{
    Quit value * 2
}

}

All diagnostics