Skip to content

Commit 70eb85c

Browse files
authored
Adjust wording about extension vs. static method conflicts (#2207)
The section about extensions in the language specification had an imprecise wording about conflicts involving an extension member (static or not) and a member of the class `Object`. This PR clarifies the text: Such conflicts only arise when the member of `Object` is an instance member.
1 parent 4340e79 commit 70eb85c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

specification/dartLangSpec.tex

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
% - Adjust and clarify simple string interpolation (to allow `'$this'`, which
4040
% is already implemented and useful).
4141
% - Add several lexical rules about identifiers, clarifying different kinds.
42+
% - Clarify the conflicts between extension members and `Object` instance
43+
% members.
4244
%
4345
% 2.14
4446
% - Add constraint on type of parameter which is covariant-by-declaration in
@@ -5837,8 +5839,13 @@ \section{Extensions}
58375839
\item $D$ declares a type parameter named \code{E}.
58385840
\item $D$ declares a member whose basename is the name of a type parameter
58395841
of $D$.
5840-
\item $D$ declares a member (static or not) with the same basename as a
5841-
member declared by the built-in class \code{Object}.
5842+
\item $D$ declares an instance member or a static member whose basename is
5843+
\code{hashCode}, \code{noSuchMethod}, \code{runtimeType}, \code{toString},
5844+
or \lit{==}.
5845+
\commentary{%
5846+
That is, a member whose basename is also the name of
5847+
an instance member that every object has.%
5848+
}
58425849
\item $D$ declares a constructor.
58435850
\item $D$ declares an instance variable.
58445851
\item $D$ declares an abstract member.

0 commit comments

Comments
 (0)