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
This is just one solution but there are other, possibly cleaner, options.
Can also consider changing the productions for type to allow: type -> type-identifier
along with type -> (type-identifier)
This is cleaner but would allow any type-identifier to be parenthesized which may cause unintended side effects in other areas of the language.
The text was updated successfully, but these errors were encountered:
Location
https://github.com/apple/swift-book/blob/main/TSPL.docc/ReferenceManual/Types.md?plain=1#L1279
Description
The grammar does not currently allow for parenthesized type identifiers in type inheritance clauses.
Current grammar:
Program that isn't derivable with current grammar:
This applies to type inheritance clauses in general.
See an example with class inheritance:
Correction
Restructure the grammar to allow for parenthesized type identifiers in type inheritance classes.
Possible Solution:
This is just one solution but there are other, possibly cleaner, options.
Can also consider changing the productions for type to allow:
type -> type-identifier
along with
type -> (type-identifier)
This is cleaner but would allow any type-identifier to be parenthesized which may cause unintended side effects in other areas of the language.
The text was updated successfully, but these errors were encountered: