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

Generics details 9: forward declarations #1084

Merged
merged 57 commits into from
Apr 13, 2022
Merged

Generics details 9: forward declarations #1084

merged 57 commits into from
Apr 13, 2022

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Feb 11, 2022

Allow interfaces and implementations to be forward declared.

// Forward declare interface `F`
interface F;
class C {
  // Forward declare `C` implements `F`
  impl as F;
}
// Definitions corresponding to forward declarations
interface F { ... }
impl C as F { ... }

To allow members of interfaces with default definitions to be forward declared, prefix them with the keyword default, following #1082 .

@josh11b josh11b added the proposal A proposal label Feb 11, 2022
@josh11b josh11b added this to Draft in Proposals via automation Feb 11, 2022
@josh11b josh11b requested a review from a team February 11, 2022 21:52
@josh11b josh11b marked this pull request as ready for review February 16, 2022 00:40
@josh11b josh11b requested a review from a team as a code owner February 16, 2022 00:40
@josh11b josh11b moved this from Draft to RFC in Proposals Feb 16, 2022
@github-actions github-actions bot added the proposal rfc Proposal with request-for-comment sent out label Feb 16, 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
docs/design/generics/details.md Outdated Show resolved Hide resolved
docs/design/generics/details.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.

Didn't dig in significantly, but did an overview and wanted to say this looks really nicely captured here.

proposals/p1084.md Outdated Show resolved Hide resolved
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
@zygoloid zygoloid merged commit 48fb3d5 into carbon-language:trunk Apr 13, 2022
Proposals automation moved this from RFC to Accepted Apr 13, 2022
@github-actions github-actions bot added proposal accepted Decision made, proposal accepted and removed proposal rfc Proposal with request-for-comment sent out labels Apr 13, 2022
@josh11b josh11b deleted the forward branch April 13, 2022 20:40
chandlerc added a commit that referenced this pull request Jun 28, 2022
Allow interfaces and implementations to be forward declared.

```
// Forward declare interface `F`
interface F;
class C {
  // Forward declare `C` implements `F`
  impl as F;
}
// Definitions corresponding to forward declarations
interface F { ... }
impl C as F { ... }
```

To allow members of interfaces with default definitions to be forward declared, prefix them with the keyword `default`, following #1082.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
zygoloid added a commit to zygoloid/carbon-lang that referenced this pull request Sep 20, 2022
@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
No open projects
Proposals
Accepted
Development

Successfully merging this pull request may close these issues.

None yet

3 participants