aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler/compile.c6
-rw-r--r--tests/check.py4
2 files changed, 3 insertions, 7 deletions
diff --git a/compiler/compile.c b/compiler/compile.c
index aa489b9..7284414 100644
--- a/compiler/compile.c
+++ b/compiler/compile.c
@@ -4727,7 +4727,7 @@ static void statements(Compiler *c, const Stmt *s) {
fail_at(c, s->first->line, s->first->column, "'%s' is not a list in a field", path);
if (c->state_bound[list] || c->state_rows[list])
fail_at(c, s->first->line, s->first->column, "a list in a field changes in an item of a let's, a stored or a "
- "transient list, not of one read from a record");
+ "transient list, not of a message's rows or one read from a record");
view_changes(c, s, list, c->state_names[list]);
const Record *inner = &c->records[r->field_record[field]];
const Expr *values[FIELDS_PER_RECORD];
@@ -5371,10 +5371,6 @@ static void generate(Compiler *c, unsigned char **module, size_t *size) {
if (record < 0)
fail_at(c, c->state_line[i], c->state_column[i], "a list holds a record; '%s' is not one", c->state_target[i]);
state_ref[i] = (uint32_t)record;
- for (unsigned k = 0; k < c->records[record].fields && c->state_rows[i]; ++k)
- if (c->records[record].field_kinds[k] == LIST) /* (027's 2b and 3) */
- fail_at(c, c->state_line[i], c->state_column[i], "'%s' holds lists in its items: a message's rows do not, "
- "for now (lets', stored and transient lists do)", c->state_names[i]);
if (*c->state_key[i]) {
const Record *r = &c->records[record];
c->list_key[i] = 1 + (int)record_field(c, r, c->state_key[i], c->state_key_line[i], c->state_key_column[i]);
diff --git a/tests/check.py b/tests/check.py
index cc96c12..5a2a462 100644
--- a/tests/check.py
+++ b/tests/check.py
@@ -125,8 +125,8 @@ DIAGNOSTICS = [
' }\n }\n}\n', '16:7', 'an arm after _ is never taken'),
(JSON_M + 'state n = 0\non frame {\n let xs: list of Json\n let ms: list of M\n xs.append(Json.arr(ms))\n}\n', '14:22',
"'arr' holds a list of Json, not of M"),
- (JSON_M + 'input m = message {\n docs: list of Json\n}\non m {\n require m.docs.count > 0\n}\n', '11:17',
- "holds lists in its items: a message's rows do not, for now"),
+ (JSON_M + 'input m = message {\n docs: list of Json\n}\non m {\n for d in m.docs {\n d.arr.append(Json.null)\n }\n}\n',
+ '15:5', "not of a message's rows or one read from a record"),
(JSON_M + 'state n = 0\non frame {\n let ms: list of M\n for m in ms {\n n = m.value\n }\n}\n', '14:9',
"'value' holds a variant: match it"),
('record P {\n x = 0\n}\nstate n = 0\non frame {\n let ps: list of P\n match ps.first {\n _ => n = 1\n }\n}\n', '7:9',