From 70eb85cf9a6606a9da0de824a5d55fd06de1287f Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Sat, 30 Apr 2022 09:52:51 +0200 Subject: [PATCH] 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. --- specification/dartLangSpec.tex | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index 01ed71104d..f3366b40f3 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -39,6 +39,8 @@ % - Adjust and clarify simple string interpolation (to allow `'$this'`, which % is already implemented and useful). % - Add several lexical rules about identifiers, clarifying different kinds. +% - Clarify the conflicts between extension members and `Object` instance +% members. % % 2.14 % - Add constraint on type of parameter which is covariant-by-declaration in @@ -5837,8 +5839,13 @@ \section{Extensions} \item $D$ declares a type parameter named \code{E}. \item $D$ declares a member whose basename is the name of a type parameter of $D$. -\item $D$ declares a member (static or not) with the same basename as a - member declared by the built-in class \code{Object}. +\item $D$ declares an instance member or a static member whose basename is + \code{hashCode}, \code{noSuchMethod}, \code{runtimeType}, \code{toString}, + or \lit{==}. + \commentary{% + That is, a member whose basename is also the name of + an instance member that every object has.% + } \item $D$ declares a constructor. \item $D$ declares an instance variable. \item $D$ declares an abstract member.