From 3dfa80bb96e79cee3204a284e1a3914aa7f0ea70 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Thu, 21 Sep 2023 15:11:51 +0200 Subject: [PATCH] Added rule that `super` in an extension type member is an error --- .../extension-types/feature-specification.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/accepted/future-releases/extension-types/feature-specification.md b/accepted/future-releases/extension-types/feature-specification.md index e2894a5ae9..0ef63a337b 100644 --- a/accepted/future-releases/extension-types/feature-specification.md +++ b/accepted/future-releases/extension-types/feature-specification.md @@ -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