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

Build a generic representing the parameterization of the body of an interface by its implicit Self parameter. #4190

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Aug 5, 2024

This is distinct from the generic representing the interface itself, which may or may not exist but doesn't have the Self parameter.

For formatting purposes, I've merged the inner generic into the interface definition rather than adding a separate nested generic block. That seemed like the most logical option given that an interface definition is always generic and doesn't have parameters of its own, and this avoids an extra level of indentation for every interface. I'm also using the same SemIR scope name for the two generics and the interface itself, to minimize scope qualifications.

This is in preparation for using specifics of the generic with self for checking impls and uses of the interface rather than performing a from-scratch substitution each time.

interface by its implicit `Self` parameter.

This is distinct from the generic representing the interface itself,
which may or may not exist but doesn't have the `Self` parameter.

For formatting purposes, I've merged the inner generic into the
interface definition rather than adding a separate nested `generic`
block. That seemed like the most logical option given that an interface
definition is always generic and doesn't have parameters of its own, and
this avoids an extra level of indentation for every interface. I'm also
using the same SemIR scope name for the two generics and the interface
itself, to minimize scope qualifications.
@zygoloid zygoloid marked this pull request as draft August 7, 2024 00:22
@zygoloid
Copy link
Contributor Author

zygoloid commented Aug 7, 2024

Converted to draft: I'm not confident this is the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant