Skip to content

Commit 1779c97

Browse files
committed
Disallow check in a parameter default expression
Disallowing check in a default expression should apply to default expressions generally, both in record fields and in function parameters. Previously #886 disallowed it just for record fields, but it needs to be disallowed for function parameters also. Fixes #1301.
1 parent f44b0f4 commit 1779c97

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lang/spec.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -1819,10 +1819,9 @@ <h5>Record types</h5>
18191819
href="#isolated_functions">isolated function</a>. The closure is evaluated to
18201820
create a field value each time the default is used in the construction of a
18211821
mapping value. The default value does not affect the type described by the type
1822-
descriptor. It is a compile-time error if a default-expression in an
1823-
individual-field-descriptor contains a checking-expr with a checking-keyword of
1824-
<code>check</code>, i.e. if evaluation of the expression could complete abruptly
1825-
with a check-fail.
1822+
descriptor. It is a compile-time error if a default-expression
1823+
contains a checking-expr with a checking-keyword of <code>check</code>,
1824+
i.e. if evaluation of the expression could complete abruptly with a check-fail.
18261825
</p>
18271826
<p>
18281827
A <code>record-type-inclusion</code> includes fields from a named record type.

0 commit comments

Comments
 (0)