projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9182cbf
)
[project @ 2004-03-11 14:29:59 by simonpj]
author
simonpj
<unknown>
Thu, 11 Mar 2004 14:29:59 +0000
(14:29 +0000)
committer
simonpj
<unknown>
Thu, 11 Mar 2004 14:29:59 +0000
(14:29 +0000)
Add sanity check
ghc/compiler/types/InstEnv.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/types/InstEnv.lhs
b/ghc/compiler/types/InstEnv.lhs
index
cc75492
..
905cde2
100644
(file)
--- a/
ghc/compiler/types/InstEnv.lhs
+++ b/
ghc/compiler/types/InstEnv.lhs
@@
-299,7
+299,10
@@
lookup_inst_env env key_cls key_tys
Nothing
-- Does not match, so next check whether the things unify
-- [see notes about overlapping instances above]
Nothing
-- Does not match, so next check whether the things unify
-- [see notes about overlapping instances above]
- -> case unifyTyListsX (key_vars `unionVarSet` tpl_tyvars) key_tys tpl of
+ -> ASSERT( not (key_vars `intersectsVarSet` tpl_tyvars) )
+ -- Unification will break badly if the variables overlap
+ -- They shouldn't because we allocate separate uniques for them
+ case unifyTyListsX (key_vars `unionVarSet` tpl_tyvars) key_tys tpl of
Just _ -> find rest ms (dfun_id:us)
Nothing -> find rest ms us
Just _ -> find rest ms (dfun_id:us)
Nothing -> find rest ms us