@@ -2071,7 +2071,8 @@ \subsection{Formal Parameters}
2071
2071
\Index{formal parameter list},
2072
2072
which consists of a list of required positional parameters
2073
2073
(\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}).
2075
2076
The latter may be specified
2076
2077
either as a list of optional positional parameters,
2077
2078
or as a set of named parameters,
@@ -2275,8 +2276,14 @@ \subsubsection{Required Formals}
2275
2276
an instance method, instance setter, or instance operator.
2276
2277
2277
2278
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.
2280
2287
2281
2288
\LMHash{}%
2282
2289
Optional formal parameters may be specified and provided with default values.
@@ -2288,7 +2295,7 @@ \subsubsection{Optional and Named Formals}
2288
2295
2289
2296
<defaultNamedParameter> ::= \gnewline{}
2290
2297
<metadata> \REQUIRED? <normalFormalParameterNoMetadata>
2291
- \gnewline{} (`: ' <expression>)?
2298
+ \gnewline{} (`= ' <expression>)?
2292
2299
\end{grammar}
2293
2300
2294
2301
\LMHash{}%
@@ -2306,7 +2313,7 @@ \subsubsection{Optional and Named Formals}
2306
2313
\Error{compile-time error} if a required named parameter has a default value.
2307
2314
2308
2315
\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$.
2310
2317
It is a \Error{compile-time error}
2311
2318
if the static type of $d$ is not assignable to the declared type of $p$.
2312
2319
0 commit comments