Skip to content

Commit 69c5622

Browse files
authored
Fix commentary about class member conflicts and add missing error (#1676)
Fix commentary about class member conflicts. Added missing error for cyclic redirecting generative constructor
1 parent 797c275 commit 69c5622

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

specification/dartLangSpec.tex

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
% is a compile-time error except when it is a getter/setter pair.
3434
% - Change grammar to enable non-function type aliases. Correct rule for
3535
% invoking `F.staticMethod()` where `F` is a type alias.
36+
% - Add missing error for cyclic redirecting generative constructor.
3637
%
3738
% 2.8 - 2.10
3839
% - Change several warnings to compile-time errors, matching the actual
@@ -3651,6 +3652,15 @@ \subsubsection{Generative Constructors}
36513652
actual arguments to function invocations in general.%
36523653
}
36533654

3655+
\LMHash{}%
3656+
A redirecting generative constructor $q'$ is \Index{redirection-reachable}
3657+
from a redirecting generative constructor $q$ if{}f
3658+
$q'$ is the redirectee constructor of $q$,
3659+
or $q''$ is the redirectee constructor of $q$
3660+
and $q'$ is redirection-reachable from $q''$.
3661+
It is a compile-time error if a redirecting generative constructor
3662+
is redirection-reachable from itself.
3663+
36543664
\LMHash{}%
36553665
When $\ConstMetavar$ is \CONST,
36563666
it is a compile-time error if the redirectee is not a constant constructor.
@@ -4458,7 +4468,8 @@ \subsubsection{Inheritance and Overriding}
44584468
they declared or inherited (\ref{scoping}, \ref{classes}).
44594469
\item Static members are never inherited.
44604470
\item It is an error if you have a static member named $m$ in your class
4461-
and an instance member of the same name (\ref{classMemberConflicts}).
4471+
and an instance member of the same basename
4472+
(\ref{classMemberConflicts}).
44624473
\item It is an error if you have a static setter \code{$v$=},
44634474
and an instance member $v$ (\ref{setters}).
44644475
\item It is an error if you have a static getter $v$
@@ -4511,8 +4522,8 @@ \subsubsection{Inheritance and Overriding}
45114522
for a method in its interface
45124523
unless it has a non-trivial \code{noSuchMethod}
45134524
(\ref{theMethodNoSuchMethod}).
4514-
\item The identifier of a named constructor cannot be
4515-
the same as the name of a static member declared in the same class
4525+
\item The identifier of a named constructor cannot be the same as
4526+
the basename of a static member declared in the same class
45164527
(\ref{classMemberConflicts}).
45174528
\end{enumerate}%
45184529
}

0 commit comments

Comments
 (0)