Scope of static properties and methods

Each type scope has an implicit “self” binding. Unqualified member references are looked up as members of this “self” binding. For outer types the implicit “self” is always a metatype because there’s no “self” instance. For the innermost type scope, the “self” is an instance if the method is an instance method. Instance members are visible on instances, and static members are visible on metatypes. However static members are not visible on an instance. So it’s consistent, just maybe a bit confusing at first; let me know if me explanation made any sense.

14 Likes