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

Constraints must use Self #2376

Merged
merged 11 commits into from
Dec 3, 2022
Merged

Constraints must use Self #2376

merged 11 commits into from
Dec 3, 2022

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Nov 7, 2022

Require impl as constraints in an interface or constraint definition to mention Self implicitly or explicitly. Require where clauses to refer to .Self directly, or through a designator like .Foo.

@josh11b josh11b added proposal A proposal proposal draft Proposal in draft, not ready for review labels Nov 7, 2022
@josh11b josh11b marked this pull request as ready for review November 30, 2022 23:32
@github-actions github-actions bot added proposal rfc Proposal with request-for-comment sent out and removed proposal draft Proposal in draft, not ready for review labels Nov 30, 2022
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.

Looks good to me; I think this accurately captures the discussions and conclusions.

docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.md Outdated Show resolved Hide resolved
proposals/p2376.md Outdated Show resolved Hide resolved
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(drive-by comment, don't block on me -- all of this looks nice)

// ✅ Allowed
external impl forall [T:! B] T as A {}
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe add a super short summary (one sentence even) of the motivation here, based on the more detailed form you have in the proposal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a sentence. Does that cover everything you wanted?

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.

Leads are happy.

@zygoloid zygoloid merged commit 571b869 into carbon-language:trunk Dec 3, 2022
@josh11b josh11b deleted the useself branch December 3, 2022 01:12
@chandlerc chandlerc added the documentation An issue or proposed change to our documentation label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or proposed change to our documentation proposal rfc Proposal with request-for-comment sent out proposal A proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants