Skip to content

Commit db7bdbc

Browse files
authored
Added rule that super in an extension type member is an error (#3364)
1 parent 976a151 commit db7bdbc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

accepted/future-releases/extension-types/feature-specification.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,14 @@ superinterfaces `V1, .. Vk` is that the members declared by _DV_ as well as
12071207
all members of `V1, .. Vk` that are not redeclared by a declaration in _DV_
12081208
can be invoked on a receiver of the type introduced by _DV_.*
12091209

1210+
Finally, a compile-time error occurs if the body of an extension type member
1211+
contains `super`.
1212+
1213+
*For example, even in the case where a superinterface declares a member
1214+
named `m`, it is not possible to call it using `super.m(...)`. The
1215+
rationale for this rule is that there may be multiple superinterfaces
1216+
declaring a member with the same name.*
1217+
12101218

12111219
### Changes to other types and subtyping
12121220

0 commit comments

Comments
 (0)