ascot diagnostics

A6826

Warning: This ‘{ty}’ value may be undefined{expr}

The variable has a value on some of the paths that reach this use and none on the others: an assignment under a condition, or a Kill on one branch. IRIS compiles the code and raises <UNDEFINED> when it runs along a path without the value. Assign it on every path, or read it through $Get.

IRIS compiles the example, and do ##class(Demo.MaybeUndefined).Label(1) raises <UNDEFINED> when it runs.

Class Demo.MaybeUndefined
{

ClassMethod Label(count As %Integer) As %String
{
    If count > 1 Set suffix = "s"
    Quit "item" _ suffix //! A6826
}

}

All diagnostics