ascot diagnostics

A1368

Warning: Not in a class context; this relies on $this being set when it runs

..Member or $this in a routine, which has no class to resolve the member against, so the value is taken as Any. IRIS compiles it and binds $this when it runs, to the object of a method that called the routine, if one did; with no current object, ..Member raises <NO CURRENT OBJECT>. Called only from methods, the code works; passing the object in as an argument makes the dependency explicit and lets ascot check the member.

IRIS compiles the example, and do Main^Demo.NotInClass raises <NO CURRENT OBJECT> when it runs.

ROUTINE Demo.NotInClass
Main
    Write ..Name, ! //! A1368
    Quit

All diagnostics