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

Add rule that super in an extension type member is an error #3364

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Sep 21, 2023

The extension type feature specification does not specify how to deal with super when it is used in the body of a member declaration. This PR adds the rule that it is a compile-time error to do so.

We should probably indicate a different way to specify this semantics. One possible approach is to invoke a constructor that does not perform any computations (super.m() will then be something like V3(this).m()), or using a cast ((this as V3).m()), or using an intermediate extension type (such that we can write a forwarding member m2 in a context where the redeclaration that gave rise to this need in the first place does not exist: V.m calls VIntermediate.m2 which calls V3.m).

@eernstg eernstg requested a review from lrhn September 21, 2023 13:17
@eernstg eernstg merged commit db7bdbc into main Sep 21, 2023
3 checks passed
@eernstg eernstg deleted the specify_extension_type_super_error_sep23 branch September 21, 2023 13:21
@eernstg eernstg changed the title Added rule that super in an extension type member is an error Add rule that super in an extension type member is an error Sep 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.

2 participants