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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,14 @@ superinterfaces `V1, .. Vk` is that the members declared by _DV_ as well as
all members of `V1, .. Vk` that are not redeclared by a declaration in _DV_
can be invoked on a receiver of the type introduced by _DV_.*

Finally, a compile-time error occurs if the body of an extension type member
contains `super`.

*For example, even in the case where a superinterface declares a member
named `m`, it is not possible to call it using `super.m(...)`. The
rationale for this rule is that there may be multiple superinterfaces
declaring a member with the same name.*


### Changes to other types and subtyping

Expand Down