ascot diagnostics

A8914

Error: Cannot reference instance member ‘{name}’ from a class method

A class method runs without an instance, so ..Name has no object to read a property from and ..Method() none to call an instance method on; IRIS refuses to compile either. Make the method an instance method, or reach the member through an object (obj.Name).

IRIS rejects the example.

Class Demo.AccessInstanceOnlyMemberFromClassContext Extends %RegisteredObject
{

Property Name As %String;

ClassMethod Show()
{
    Write ..Name, ! //! A8914
}

}

All diagnostics