diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-07-25 11:47:45 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-07-25 12:04:31 +0100 |
commit | 857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e (patch) | |
tree | 42f2187c61b0b90df8ade7b0d51a73fcf4d48e1c /compiler/typecheck/TcHsSyn.hs | |
parent | c5d31df70b16dc346b5860077c8bbe585ddb7a78 (diff) | |
download | haskell-857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e.tar.gz |
Fix and document cloneWC
The cloneWC, cloneWanted, cloneImplication family are used by
* TcHoleErrors
* TcRule
to clone the /bindings/ in a constraint, so that solving the
constraint will not add bindings to the program. The idea is only
to affect unifications.
But I had it wrong -- I failed to clone the EvBindsVar of an
implication. That gave an assert failure, I think, as well as
useless dead code.
The fix is easy. I'm not adding a test case.
In the type 'TcEvidence.EvBindsVar', I also renamed the
'NoEvBindsVar' constructor to 'CoEvBindsVar'. It's not that we
have /no/ evidence bindings, just that we can only have coercion
bindings, done via HoleDest.
Diffstat (limited to 'compiler/typecheck/TcHsSyn.hs')
-rw-r--r-- | compiler/typecheck/TcHsSyn.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs index 73fdda9026..a4a25620e7 100644 --- a/compiler/typecheck/TcHsSyn.hs +++ b/compiler/typecheck/TcHsSyn.hs @@ -1549,7 +1549,7 @@ zonkEvBindsVar :: ZonkEnv -> EvBindsVar -> TcM (ZonkEnv, Bag EvBind) zonkEvBindsVar env (EvBindsVar { ebv_binds = ref }) = do { bs <- readMutVar ref ; zonkEvBinds env (evBindMapBinds bs) } -zonkEvBindsVar env (NoEvBindsVar {}) = return (env, emptyBag) +zonkEvBindsVar env (CoEvBindsVar {}) = return (env, emptyBag) zonkEvBinds :: ZonkEnv -> Bag EvBind -> TcM (ZonkEnv, Bag EvBind) zonkEvBinds env binds |