Arrows: correctly query arrow methods (#17423)
Consider the following code: proc (C x y) -> ... Before this patch, the evidence binding for the Arrow dictionary was attached to the C pattern: proc (C x y) { $dArrow = ... } -> ... But then when we desugar this, we use arrow operations ("arr", ">>>"...) specialised for this arrow: let arr_xy = arr $dArrow -- <-- Not in scope! ... in arr_xy (\(C x y) { $dArrow = ... } -> ...) This patch allows arrow operations to be type-checked before the proc itself, avoiding this issue. Fix #17423
Showing
- compiler/GHC/Tc/Gen/Arrow.hs 16 additions, 12 deletionscompiler/GHC/Tc/Gen/Arrow.hs
- testsuite/tests/arrows/should_compile/T17423.hs 0 additions, 0 deletionstestsuite/tests/arrows/should_compile/T17423.hs
- testsuite/tests/arrows/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/arrows/should_compile/all.T
- testsuite/tests/gadt/all.T 0 additions, 1 deletiontestsuite/tests/gadt/all.T
Loading
Please register or sign in to comment