Is the above line still a valid/accurate statement?
Self inside a static method is identical to the type it’s defined in (or extended). As a special rule, for inline methods it’s what it was originally called on.
@mh a lot of stuff is inlining specific, not sure if we need a dedicated syntax syntax.
So the document is NOT accurate?
Without inline, and inside a static method, is self identical to typeOf(self), or not?
It does NOT seem to be identical as the attached sample project shows, which contradicts to what the document says.
ConsoleApplication1.7z (25.2 KB)
@mh sounds like the documentation needs a tweak here. it refers to the ‘current type’, not typeof().
Yep, its one off several pages that have bene sitting in “status: tech-review” for a while now, for you ;).
it is kinda correct though. for example “locking self” in static method is same as “locking typeOf(self)” in a non-static?
the full docs read
staticmembers (defined with the
staticmodifier or the
selfrefers to the (platform-specific) meta-class that describes the current type. This can be assumed to be unique for each type, and distinct for separate types, and allowed for polymorphism (i.e. in descendant class,
selfwill refer to the descendant meta-class:
selfinside a static member is identical to
(self)in an instance method.