-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show example of nested protocols [SE-0404] #235
Show example of nested protocols [SE-0404] #235
Conversation
|
Pulling this back to draft because |
This approach doesn't rely (directly or indirectly) on existential types. The old example used two protocols at the same scope, in part because protocol nesting wasn't supported when this was first written. That's no longer needed -- we can now show a delegate protocol nested inside the type it supports.
The discussion of how the delegate can access the type that's doing the delegation is no longer relevant -- DiceGameTracker doesn't access any game state, and there's no longer a need to define a protocol for the delegating type to conform to. So that explanation was removed without replacement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice example!
Co-authored-by: Karl <5254025+karwa@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with suggested edits. There are a couple suggested wording changes in here, but prefer defaulting to overall style of the Guide if there's a conflict.
Please let me know if you'd like to discuss or feel free to incorporate the revisions and merge.
Thank you.
Co-authored-by: Chuck Toporek <chuck_toporek@apple.com>
Didn't add an example to the tour, because it doesn't show nested types — we can revise that separately.
Fixes: rdar://117101695