diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index 0f7427576f..54d079cd02 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -2071,7 +2071,8 @@ \subsection{Formal Parameters} \Index{formal parameter list}, which consists of a list of required positional parameters (\ref{requiredFormals}), -followed by any optional and/or named parameters (\ref{optionalFormals}). +followed by any optional and/or named parameters +(\ref{optionalFormalsAndNamedFormals}). The latter may be specified either as a list of optional positional parameters, or as a set of named parameters, @@ -2275,8 +2276,14 @@ \subsubsection{Required Formals} an instance method, instance setter, or instance operator. -\subsubsection{Optional and Named Formals} -\LMLabel{optionalFormals} +\subsubsection{Optional Formals and Named Formals} +\LMLabel{optionalFormalsAndNamedFormals} + +\LMHash{}% +This section is concerned with optional parameters, +positional or named, +and with required named parameters. +They are handled together because they share grammar rules. \LMHash{}% Optional formal parameters may be specified and provided with default values. @@ -2288,7 +2295,7 @@ \subsubsection{Optional and Named Formals} ::= \gnewline{} \REQUIRED? - \gnewline{} (`:' )? + \gnewline{} (`=' )? \end{grammar} \LMHash{}% @@ -2306,7 +2313,7 @@ \subsubsection{Optional and Named Formals} \Error{compile-time error} if a required named parameter has a default value. \LMHash{}% -Assume that $p$ is an optional named parameter with default value $d$. +Assume that $p$ is an optional parameter with default value $d$. It is a \Error{compile-time error} if the static type of $d$ is not assignable to the declared type of $p$.