@@ -5230,7 +5230,11 @@ \subsubsection{Inheritance and Overriding}
5230
5230
\commentary{%
5231
5231
Note that an interface can inherit members that are inaccessible
5232
5232
(because they are private to a different library),
5233
- but it can only override members that are accessible.%
5233
+ but it can only override members that are accessible.
5234
+ This is the reason why it is called ``with respect to $K$''
5235
+ when the topic is inheritance,
5236
+ but no library is mentioned when the topic is overriding:
5237
+ only one library is relevant, namely the one that declares $C$.%
5234
5238
}
5235
5239
5236
5240
\LMHash{}%
@@ -5240,12 +5244,15 @@ \subsubsection{Inheritance and Overriding}
5240
5244
or $I$ overrides $m$.
5241
5245
5242
5246
\LMHash{}%
5243
- \BlindDefineSymbol{I, K, n, m}%
5244
- Let $I$ be an interface, $K$ a library, and
5245
- $n$ a name such that a member $m$ with the name $n$
5247
+ \BlindDefineSymbol{I, C, K, n, m}%
5248
+ Let $I$ be the interface of the class $C$ declared by the library $L$,
5249
+ $K$ a library
5250
+ (\commentary{which may or may not be the same as $L$}),
5251
+ and $n$ a name such that a member $m$ with the name $n$
5246
5252
is inherited by $I$ with respect to $K$.
5247
5253
\commentary{%
5248
- Note that there may be more than one such member.%
5254
+ Note that there may be more than one such member,
5255
+ and also that $C$ does not override $m$.%
5249
5256
}
5250
5257
The
5251
5258
\IndexCustom{member signature}{interface!member signature}
@@ -5257,6 +5264,21 @@ \subsubsection{Inheritance and Overriding}
5257
5264
\IndexCustom{member signature conflict}{interface!member signature conflict}
5258
5265
with respect to $n$ and $K$.
5259
5266
5267
+ \commentary{%
5268
+ When $n$ is a public name, $K$ can be $L$
5269
+ or any other library where $C$ is in scope.
5270
+ In other words, $K$ does not matter.
5271
+ But when $n$ is a private name then
5272
+ $K$ must be the library that declares $m$,
5273
+ such that $m$ is accessible to $K$.
5274
+ This covers the case where the interface $I$
5275
+ (as well as the underlying class $C$) has
5276
+ a member signature conflict on
5277
+ a member which is private to another library.
5278
+ This can be a compile-time error
5279
+ (\ref{classes}).%
5280
+ }
5281
+
5260
5282
5261
5283
\subsubsection{Correct Member Overrides}
5262
5284
\LMLabel{correctMemberOverrides}
0 commit comments