unison/unison-src/transcripts/fix2663.md
Greg Pfeil b657d0dd50
Fix a few transcripts with incorrect Markdown
These weren’t errors in any way, but the `cmark`-produced outputs made
it clear that some of our transcripts weren’t formatted the way we
intended.
2024-07-10 13:56:10 -06:00

410 B

Tests a variable capture problem.

After pattern compilation, the match would end up:

T p1 p3 p3

and z would end up referring to the first p3 rather than the second.

scratch/main> builtins.merge
structural type Trip = T Nat Nat Nat

bad : Nat -> (Nat, Nat)
bad x = match Some (Some x) with
  Some (Some x) -> match T 3 4 5 with
    T _ _ z -> (x, z)
  _ -> (0,0)

> bad 2