ascot diagnostics

S4151

Warning: Use Return to leave a method or procedure; Quit is for loops and Try blocks

Under {"allowQuitForReturn":false}, this Quit stands in no loop, Try or Catch block, and an If block does not count as one. Such a Quit leaves the method, procedure or label, which is what Return does. Write Return instead. Keep Quit for leaving a loop, Try or Catch block, where Return would leave the whole method.

IRIS compiles the example. Checked with the style {"allowQuitForReturn":false}.

Class Demo.QuitExits
{

ClassMethod CountTo(limit As %Integer) As %Integer
{
    Set count = 0
    For {
        Set count = count + 1
        If count >= limit Quit
    }
    Quit count //! S4151
}

}

All diagnostics