unison icon indicating copy to clipboard operation
unison copied to clipboard

Type ascriptions can break the parser

Open ceedubs opened this issue 3 months ago • 0 comments

Describe and demonstrate the bug

``` ucm
> builtins.merge

  Done.
```

``` unison
> 3
```

``` ucm :added-by-ucm
  Loading changes detected in scratch.u.

  No changes found.

    1 | > 3
          ⧩
          3
```

``` unison
> (3 : Nat)
```

``` ucm :added-by-ucm
  Loading changes detected in scratch.u.

  No changes found.

    1 | > (3 : Nat)
          ⧩
          3
```

``` unison
> 3 : Nat
```

🛑

The transcript failed due to an error in the stanza above. The error is:

``` 
I got confused here:

    1 | > 3 : Nat


I was surprised to find a ':' here.
I was expecting one of these instead:

* and
* bang
* do
* false
* force
* handle
* if
* infixApp
* let
* newline or semicolon
* or
* quote
* termLink
* true
* tuple
* typeLink
```

Environment (please complete the following information):

  • ucm --version a330f6040

Additional context

The term Unit.doc in base currently doesn't compile because it has a similar code block inside a doc literal.

ceedubs avatar Sep 22 '25 19:09 ceedubs