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

Member binding operators #3720

Merged
merged 79 commits into from
May 25, 2024
Merged

Member binding operators #3720

merged 79 commits into from
May 25, 2024

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Feb 22, 2024

Define the binding operation used to compute the result of x.y, p->y, x.(C.y), and p->(C.y) as calling a method from user-implementable interfaces.

@josh11b josh11b added proposal A proposal proposal draft Proposal in draft, not ready for review labels Feb 22, 2024
@josh11b josh11b marked this pull request as ready for review February 29, 2024 00:36
@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 Feb 29, 2024
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

I think there's good detail here on ValueBind and RefBind. I do have several questions about extend api; it's not clear to me what the implementation of this would look like, so I'd like to have more specifics.

proposals/p3720.md Outdated Show resolved Hide resolved
proposals/p3720.md Show resolved Hide resolved
proposals/p3720.md Outdated Show resolved Hide resolved
proposals/p3720.md Outdated Show resolved Hide resolved
proposals/p3720.md Outdated Show resolved Hide resolved
proposals/p3720.md Outdated Show resolved Hide resolved
proposals/p3720.md Outdated Show resolved Hide resolved
proposals/p3720.md Outdated Show resolved Hide resolved
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
proposals/p3720.md Outdated Show resolved Hide resolved
This was referenced May 15, 2024
proposals/p3720.md Show resolved Hide resolved
proposals/p3720.md Show resolved Hide resolved
proposals/p3720.md 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; I think this is ready to go ahead. There's one thing I'd like double-checked here, and one more coherence concern, but I think the latter is pre-existing so shouldn't block this proposal.

@josh11b josh11b changed the title Binding operators Member binding operators May 23, 2024
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, thanks!

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.

LGTM as well!!!

proposals/p3720.md Outdated Show resolved Hide resolved
josh11b and others added 2 commits May 24, 2024 19:02
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
@josh11b josh11b enabled auto-merge May 25, 2024 02:03
@josh11b josh11b added this pull request to the merge queue May 25, 2024
Merged via the queue into carbon-language:trunk with commit 679d57d May 25, 2024
7 checks passed
@josh11b josh11b deleted the bind branch May 25, 2024 02:11
josh11b added a commit to josh11b/carbon-lang that referenced this pull request May 27, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 13, 2024
Instead of the `call` instruction having a block with one argument per
explicit argument, preceded optionally by `self` and followed optionally
by a return slot, change the `call` to store only the *runtime*
arguments. Store an index on the runtime parameters to make it easier to
determine the correspondence between arguments and parameters in a call.
Compile-time parameters, whether implicit or explicit, are no longer
included in the call argument list. Instead, they're tracked only in the
`specific_id` on the callee.

For calls to generic classes and generic interfaces, it no longer makes
sense to form a `call` instruction, given that the entirety of the
result is determined by the `specific_id`, which is now formed when
checking the call. Instead, the `call` instruction now only models
function calls, and not calls to other kinds of parameterized entity
names, and we create a `class_type` or `interface_type` instead of a
`call` instruction to model these kinds of calls. Notionally the model
here is that we're following the #3720 approach for calls, but for now
we inline the `Call.Op` function when forming SemIR.

We now also track the enclosing specific for a generic class or generic
interface that appears within an enclosing generic. This is necessary in
order for deduction of the inner generic parameters to not get confused
by the outer generic parameters being absent.

In order to not regress diagnostics, the template argument deduction
mechanism has been extended to specify the name of the parameter we're
deducing against when possible, and call arity mismatch errors are now
diagnosed before performing deduction rather than afterwards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants