ascot diagnostics

A6781

Error: Returns nothing where ‘{wanted}’ is declared

The method declares a return type, and this Quit or Return has no value to give it. IRIS compiles the method, and a caller that takes the value (Set x = ..Half(3)) raises <COMMAND> when this Quit runs; Do tolerates it. Return a value of the declared type, or drop the As clause if the method has nothing to return.

IRIS compiles the example, and write ##class(Demo.ReturnNothingForX).Half(3) raises <COMMAND> when it runs.

Class Demo.ReturnNothingForX
{

ClassMethod Half(n As %Integer) As %Integer
{
    If n # 2 Quit //! A6781
    Quit n / 2
}

}

All diagnostics