Skip to content

Commit 5e9bfb6

Browse files
cknittclaude
andcommitted
Say in rule 6 that variants with some @unboxed constructors are checked
#9021 checks a variant with some `@unboxed` constructors like an untagged one: tagged blocks count as one object case, and an untagged case's `@as` is not a tag. Rule 6 now says so and names its tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMkrYaktctdKc4M41WF36t Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent 12df5b7 commit 5e9bfb6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎compiler/ml/UntaggedVariants.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,14 @@ written (Known bugs).
216216

217217
### 6. Well-formedness
218218

219-
The type checker rejects an untagged variant, with
220-
"This untagged variant definition is invalid: ..." and the reason below, when:
219+
The type checker rejects a variant with an untagged case, with
220+
"This untagged variant definition is invalid: ..." and the reason below, when
221+
the condition holds. This includes a variant where only some constructors are
222+
`@unboxed` (rule 1). There, the tagged blocks together count as one object
223+
case, and the `@as` of an untagged case is not a tag, so it does not clash
224+
with a tagged case's (`untagged_mixed_test.res`; fixtures
225+
`untagged_mixed_two_numbers.res`, `untagged_mixed_unknown_payload.res`,
226+
`untagged_mixed_object_and_tagged.res`; #9020).
221227

222228
| Condition | Reason | Fixture |
223229
| --- | --- | --- |

0 commit comments

Comments
 (0)