-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Updates to generics design details, part 2 #3253
Conversation
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.
(Checkpoint of incomplete review)
Co-authored-by: Richard Smith <[email protected]>
Co-authored-by: Richard Smith <[email protected]>
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.
Thanks, I think we're basically converged here. I'm happy to take another look if you like after the Container
example is fixed, but I don't feel it's necessary.
docs/design/generics/details.md
Outdated
Functions accepting a generic type might also want to constrain one of its | ||
associated types to be a specific, concrete type. For example, we might want to | ||
have a function only accept stacks containing integers: | ||
let SliceType:! Container |
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.
This is doing name lookup on the next line: where .ElementType =
is looking up ElementType
in the incomplete interface Container
(after the declaration of ElementType
), and .SliceType =
is looking up the member that we're in the middle of declaring. I think this example needs to be reworked a bit.
Co-authored-by: Richard Smith <[email protected]>
Co-authored-by: Richard Smith <[email protected]>
Continued from part 1: #3231. Second step updating
docs/design/generics/details.md
. There remains some work to incorporate proposal #2200.type
#2360let
withauto
? #996TypeId
.impl
declaration and definitions with theimpls
operator used inwhere
clauses, an issue brought up inis
inwhere
...is
constraints #2495is
withimpls
#2483