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

Feature specification of #3090, allowing an inline class to implement its representation type #3138

Closed
wants to merge 16 commits into from

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Jun 8, 2023

This PR contains a proposal for an addendum to the feature specification of inline classes, specifying how we could support the situation where an inline class V has an implements ... R clause where R is the representation type (or any supertype thereof).

The point is that this provides (1) the subtype relationship V <: R, and (2) a receiver of type V can have members of R invoked on it.

In this proposal, V is allowed to redeclare members of R (which means that V "overrides" the implementation of that member, albeit with static dispatch only).

Conflict resolution is specified to be the same as it has always been for superinterfaces: If both R and some other superinterface have a member with the same name then there is an error, but V can redeclare the member and that will resolve the conflict.

This was referenced Jun 30, 2023
@eernstg
Copy link
Member Author

eernstg commented Jul 6, 2023

Note that the proposal in this PR is included in the proposal about extension types, #3182.

@eernstg
Copy link
Member Author

eernstg commented Jul 21, 2023

Closing: This feature has been included in the 'extension types' feature specification, so there's no need to have a separate feature specification (which is what this PR will add).

@eernstg eernstg closed this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants