You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered: