From 1779c97d4b5d4b620cc3902b933389ac9a01c163 Mon Sep 17 00:00:00 2001 From: James Clark Date: Thu, 18 Jul 2024 15:48:48 +0700 Subject: [PATCH] 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. --- lang/spec.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lang/spec.html b/lang/spec.html index 856bfafe..0cac90e3 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -1819,10 +1819,9 @@
Record types
href="#isolated_functions">isolated function. 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 -check, 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 check, +i.e. if evaluation of the expression could complete abruptly with a check-fail.

A record-type-inclusion includes fields from a named record type.