ascot diagnostics

A7762

Hint: ‘{name}’ is never read before it is assigned; Output fits better than ByRef

A ByRef parameter whose incoming value no path reads before writing it: the body only produces the value, so the caller need not pass one, which is what Output declares and what lets a caller leave the argument out. IRIS compiles either; the caller’s . alone passes by reference, and the mode documents intent. If the parameter is indeed only produced, Output says so; if a caller is meant to pass a value the body reads in a case ascot doesn’t see, ByRef is right.

IRIS compiles the example.

Class Demo.ByRefNeverRead
{

ClassMethod Defaults(ByRef timeout As %Integer) //! A7762
{
    Set timeout = 30
}

}

All diagnostics