Skip to content
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

Merged
merged 20 commits into from
Oct 3, 2023
Merged

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Sep 22, 2023

Continued from part 1: #3231. Second step updating docs/design/generics/details.md. There remains some work to incorporate proposal #2200.

@github-actions github-actions bot requested a review from chandlerc September 22, 2023 21:46
@josh11b josh11b requested review from zygoloid and removed request for chandlerc September 22, 2023 22:56
Copy link
Contributor

@zygoloid zygoloid left a 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)

docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
@josh11b josh11b requested a review from zygoloid September 29, 2023 03:25
Copy link
Contributor

@zygoloid zygoloid left a 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 Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Show resolved Hide resolved
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
Copy link
Contributor

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.

@josh11b josh11b added this pull request to the merge queue Oct 3, 2023
Merged via the queue into carbon-language:trunk with commit 88e87b8 Oct 3, 2023
6 checks passed
@josh11b josh11b deleted the a branch October 3, 2023 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants