Skip to content

Commit

Permalink
Disallow check in a parameter default expression
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jclark committed Jul 18, 2024
1 parent f44b0f4 commit 1779c97
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1819,10 +1819,9 @@ <h5>Record types</h5>
href="#isolated_functions">isolated function</a>. The closure is evaluated to
create a field value each time the default is used in the construction of a
mapping value. The default value does not affect the type described by the type
descriptor. It is a compile-time error if a default-expression in an
individual-field-descriptor contains a checking-expr with a checking-keyword of
<code>check</code>, i.e. if evaluation of the expression could complete abruptly
with a check-fail.
descriptor. It is a compile-time error if a default-expression
contains a checking-expr with a checking-keyword of <code>check</code>,
i.e. if evaluation of the expression could complete abruptly with a check-fail.
</p>
<p>
A <code>record-type-inclusion</code> includes fields from a named record type.
Expand Down

0 comments on commit 1779c97

Please sign in to comment.