ascot diagnostics

A4025

Error: The callee’s public list names ‘{name}’, which is private here

The callee’s public list names a variable that is private here. In a procedure block, a local the public list does not name is private. IRIS compiles the call, and the callee works on the public variable of that name. Unless code outside the block set it, that variable is undefined, and reading it raises <UNDEFINED>. Add the variable to this block’s public list, or pass it as an argument.

IRIS compiles the example, and do Main^Demo.RequirePrivateVariable raises <UNDEFINED> when it runs.

ROUTINE Demo.RequirePrivateVariable
Main() Public {
    Set total = 0
    Do Add(5) //! A4025
    Write total, !
    Quit
}
Add(n) [total] {
    Set total = total + n
    Quit
}

All diagnostics