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

Generic details 10: interface-implemented requirements #1088

Merged
merged 23 commits into from
May 5, 2022
Merged

Generic details 10: interface-implemented requirements #1088

merged 23 commits into from
May 5, 2022

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Feb 16, 2022

This proposal:

  • Adds support for interfaces requiring other types than Self to implement interfaces, as in:
    interface IntLike {
      impl i32 as As(Self);
      // ...
    }
    
  • Defines requirements on how to satisfy those requirements that have a where clause.
  • Extends observe declarations to include saying a type implements an interface, so code can provide a proof instead of the compiler having to perform a recursive search.

@josh11b josh11b added the proposal A proposal label Feb 16, 2022
@josh11b josh11b requested a review from a team February 16, 2022 21:16
@josh11b josh11b changed the title Generic details 10: interface implemented requirements Generic details 10: interface-implemented requirements Mar 5, 2022
@josh11b josh11b marked this pull request as ready for review March 7, 2022 20:13
@josh11b josh11b requested a review from a team as a code owner March 7, 2022 20:13
@github-actions github-actions bot added the proposal rfc Proposal with request-for-comment sent out label Mar 7, 2022
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
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. A couple of minor suggestions; please feel free to merge once they're handled.

docs/design/generics/details.md Outdated Show resolved Hide resolved
@josh11b josh11b merged commit f266df8 into carbon-language:trunk May 5, 2022
@josh11b josh11b deleted the deps branch May 5, 2022 22:30
@github-actions github-actions bot added proposal accepted Decision made, proposal accepted and removed proposal rfc Proposal with request-for-comment sent out labels May 5, 2022
chandlerc pushed a commit that referenced this pull request Jun 28, 2022
This proposal:

- Adds support for interfaces requiring other types than `Self` to implement interfaces, as in:
  ```
  interface IntLike {
    impl i32 as As(Self);
    // ...
  }
  ```
- Defines requirements on how to satisfy those requirements that have a `where` clause.
- Extends `observe` declarations to include saying a type implements an interface, so code can provide a proof instead of the compiler having to perform a recursive search.

Co-authored-by: Richard Smith <[email protected]>
@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 accepted Decision made, proposal accepted proposal A proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants