Writing Self.someStaticMember to access a member of the current type is the same as writing type(of: self).someStaticMember.
The currently grammar only accepts identifier as first token of a type-identifier, but IMHO it should accept Self to allow for Self.someStaticMember. If I understood the grammar rules correctly, then Self is always a keyword in Self.someStaticMember and thus not covered by identifier in the rule below.
Location
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/types#Type-Identifier
Description
The grammar accepts a type annotation like
: SomeType.SubSequence
, but does not accept: Self.SubSequence
.https://docs.swift.org/swift-book/documentation/the-swift-programming-language/types#Self-Type mentions that something like
Self.someStaticMember
is valid:The currently grammar only accepts
identifier
as first token of atype-identifier
, but IMHO it should acceptSelf
to allow forSelf.someStaticMember
. If I understood the grammar rules correctly, thenSelf
is always a keyword inSelf.someStaticMember
and thus not covered byidentifier
in the rule below.Correction
No response