unison/unison-src/transcripts/fix3244.md
2024-06-25 11:11:07 -07:00

408 B

scratch/main> builtins.merge

This tests an previously erroneous case in the pattern compiler. It was assuming that the variables bound in a guard matched the variables bound in the rest of the branch exactly, but apparently this needn't be the case.


foo t =
  (x, _) = t
  f w = w + x

  match t with
    (x, y)
      | y < 5 -> f x
      | otherwise -> x + y

> foo (10,20)