unison icon indicating copy to clipboard operation
unison copied to clipboard

`cases` block needs surrounding parens in Doc only

Open aryairani opened this issue 1 month ago • 2 comments

Describe and demonstrate the bug

> builtins.mergeio

  Done.
x.doc = {{
```
cases x -> 1 -- fails
```
}}
  Loading changes detected in scratch.u.

  I got confused here:



  I was surprised to find an end of input here.
x.doc = {{
```
(cases x -> 1) -- ok
```
}}
  Loading changes detected in scratch.u.

  + x.doc : Doc2

  Run `update` to apply these changes to your codebase.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • unison version: 3c5e994'
  • OS/Architecture: macOS 26.0.1 arm

Additional context is this related to #5473 ?

aryairani avatar Nov 04 '25 21:11 aryairani

Did you run into this issue outside of a transcript originally?

I can replicate the behavior in a transcript, but as soon as I try to minimize the test case (e.g., a parser unit test) the block parses exactly as I’d expect. If you’ve only seen this in a transcript, maybe that’s where the issue lies (although the transcript runner just takes each block and loads it like a file, so it doesn’t really have a distinct codepath).

sellout avatar Nov 05 '25 02:11 sellout

Ah, I can replicate it in a scratch file too. But still odd that unit tests, etc. work.

sellout avatar Nov 05 '25 04:11 sellout