Skip to content

Commit 0ddc130

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 6e2ddc0 commit 0ddc130

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
@@ -2294,7 +2294,8 @@ \subsection{Formal Parameters}
22942294
\Index{formal parameter list},
22952295
which consists of a list of required positional parameters
22962296
(\ref{requiredFormals}),
2297-
followed by any optional and/or named parameters (\ref{optionalFormals}).
2297+
followed by any optional and/or named parameters
2298+
(\ref{optionalFormalsAndNamedFormals}).
22982299
The latter may be specified
22992300
either as a list of optional positional parameters,
23002301
or as a set of named parameters,
@@ -2498,8 +2499,14 @@ \subsubsection{Required Formals}
24982499
an instance method, instance setter, or instance operator.
24992500

25002501

2501-
\subsubsection{Optional and Named Formals}
2502-
\LMLabel{optionalFormals}
2502+
\subsubsection{Optional Formals and Named Formals}
2503+
\LMLabel{optionalFormalsAndNamedFormals}
2504+
2505+
\LMHash{}%
2506+
This section is concerned with optional parameters,
2507+
positional or named,
2508+
and with required named parameters.
2509+
They are handled together because they share grammar rules.
25032510

25042511
\LMHash{}%
25052512
Optional formal parameters may be specified and provided with default values.
@@ -2511,7 +2518,7 @@ \subsubsection{Optional and Named Formals}
25112518

25122519
<defaultNamedParameter> ::= \gnewline{}
25132520
<metadata> \REQUIRED? <normalFormalParameterNoMetadata>
2514-
\gnewline{} (`:' <expression>)?
2521+
\gnewline{} (`=' <expression>)?
25152522
\end{grammar}
25162523

25172524
\LMHash{}%
@@ -2529,7 +2536,7 @@ \subsubsection{Optional and Named Formals}
25292536
\Error{compile-time error} if a required named parameter has a default value.
25302537

25312538
\LMHash{}%
2532-
Assume that $p$ is an optional named parameter with default value $d$.
2539+
Assume that $p$ is an optional parameter with default value $d$.
25332540
It is a \Error{compile-time error}
25342541
if the static type of $d$ is not assignable to the declared type of $p$.
25352542

0 commit comments

Comments
 (0)