Error: Cannot NEW the private variable ‘{name}’ in a procedure block
New names a variable private to the procedure block: a parameter, or a local the body
creates, which the block already scopes to itself on entry. IRIS refuses to compile it:
#1038 Private variable not allowed. Delete the New, or Kill the variable if its value
is to go; only a variable of the block’s public list can be New‘d.
IRIS rejects the example.
Class Demo.NewInProcedureBlock
{
ClassMethod Total(hours As %Integer, overtime As %Integer) As %Integer
{
New sum //! A6866
Set sum = hours + overtime
Quit sum
}
}