Does this feature have a general name? Swift users seem to call it "dot syntax", which is not a good name. I want to google "C++ should have <this feature>" and find a proposal from 2013 that never moved forward, but "C++ should have dot syntax" is just silly.
Ada doesn't use the "dot syntax"; instead the enumeration literal is written as is without a dot. If I write:
type Number_System is (Bin, Dec, Oct);
type Month is (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
procedure Foo (A: Number_System; B: Month);
When the type is explicit, the Ada standard calls this a "Qualified expression". But I would just say that it is a kind of type inference for enumerations.
It’s not just for enums in Swift, it’s applicable to all kinds of static functions, constants, initialisers. Has to be static (in the Swift/Java/etc sense) to work. Maybe “contextual members” or “contextual statics”. I like the latter.