unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.78k stars 270 forks source link

some bad interaction between destructuring bind, nested functions, and pattern checker? #5248

Open aryairani opened 3 months ago

aryairani commented 3 months ago

Describe and demonstrate the bug Please attach a ucm transcript if possible, calling out the unexpected behavior in the text. e.g.

Input:

This fails
```unison:error
foo = do
  use List :+ +:
  input = []
  (xs, ys) =
    go ls rs = cases
      [] -> (ls, rs)
      ((l, r) +: rest) -> go (ls :+ l) (rs :+ r) rest
    go [] [] input
  ()

but this is okay

foo = do
  use List :+ +:
  input = []
  go ls rs = cases
    [] -> (ls, rs)
    ((l, r) +: rest) -> go (ls :+ l) (rs :+ r) rest
  (xs, ys) =
    go [] [] input
  ()


**Screenshots**

**Environment (please complete the following information):**
 - 0.5.25

**Additional context**
aryairani commented 3 months ago

from https://unisoncomputing.slack.com/archives/CLGTK464E/p1721746497781029