Keep the bindings local during defaultCallStacks
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 17 Aug 2016 13:35:19 +0000 (14:35 +0100)
committerBen Gamari <ben@smart-cactus.org>
Thu, 25 Aug 2016 16:29:25 +0000 (12:29 -0400)
commit829b9682969a5dabd3a75b82864c48c2e6a19ee8
tree8009e6baf9819cb8249470786f89cf54ecea5c3a
parent6071ecf4ff7501c70456c1448fa2f78e91bc8078
Keep the bindings local during defaultCallStacks

defaultCallStacks generates evidence bindings for call stacks,
but wasn't setting the binding site correctly.  As a result
they were simply discarded in the case of pattern synonyms,
giving rise to Trac #12489.

The fix is easy; and I added an ASSERT to catch the error earlier.

(cherry picked from commit f352e5cd7bb629fe0ca3b913bfbe7bee43d62f3a)
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcSimplify.hs
testsuite/tests/patsyn/should_compile/T12489.hs [new file with mode: 0644]
testsuite/tests/patsyn/should_compile/all.T