Skip to content

Commit 8f6a5e0

Browse files
committed
Add a paragraph explaining that the given section is about both optional and named parameters, not just parameters that are both
1 parent 5beba67 commit 8f6a5e0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

specification/dartLangSpec.tex

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,8 @@ \subsection{Formal Parameters}
20712071
\Index{formal parameter list},
20722072
which consists of a list of required positional parameters
20732073
(\ref{requiredFormals}),
2074-
followed by any optional and/or named parameters (\ref{optionalFormals}).
2074+
followed by any optional and/or named parameters
2075+
(\ref{optionalFormalsAndNamedFormals}).
20752076
The latter may be specified
20762077
either as a list of optional positional parameters,
20772078
or as a set of named parameters,
@@ -2275,8 +2276,14 @@ \subsubsection{Required Formals}
22752276
an instance method, instance setter, or instance operator.
22762277

22772278

2278-
\subsubsection{Optional and Named Formals}
2279-
\LMLabel{optionalFormals}
2279+
\subsubsection{Optional Formals and Named Formals}
2280+
\LMLabel{optionalFormalsAndNamedFormals}
2281+
2282+
\LMHash{}%
2283+
This section is concerned with optional parameters,
2284+
positional or named,
2285+
and with required named parameters.
2286+
They are handled together because they share grammar rules.
22802287

22812288
\LMHash{}%
22822289
Optional formal parameters may be specified and provided with default values.
@@ -2288,7 +2295,7 @@ \subsubsection{Optional and Named Formals}
22882295

22892296
<defaultNamedParameter> ::= \gnewline{}
22902297
<metadata> \REQUIRED? <normalFormalParameterNoMetadata>
2291-
\gnewline{} (`:' <expression>)?
2298+
\gnewline{} (`=' <expression>)?
22922299
\end{grammar}
22932300

22942301
\LMHash{}%
@@ -2306,7 +2313,7 @@ \subsubsection{Optional and Named Formals}
23062313
\Error{compile-time error} if a required named parameter has a default value.
23072314

23082315
\LMHash{}%
2309-
Assume that $p$ is an optional named parameter with default value $d$.
2316+
Assume that $p$ is an optional parameter with default value $d$.
23102317
It is a \Error{compile-time error}
23112318
if the static type of $d$ is not assignable to the declared type of $p$.
23122319

0 commit comments

Comments
 (0)