projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2b8e1af
)
[project @ 2005-01-05 17:49:38 by simonpj]
author
simonpj
<unknown>
Wed, 5 Jan 2005 17:49:38 +0000
(17:49 +0000)
committer
simonpj
<unknown>
Wed, 5 Jan 2005 17:49:38 +0000
(17:49 +0000)
Add assert
ghc/compiler/types/InstEnv.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/types/InstEnv.lhs
b/ghc/compiler/types/InstEnv.lhs
index
5b41bf9
..
46ab2cb
100644
(file)
--- a/
ghc/compiler/types/InstEnv.lhs
+++ b/
ghc/compiler/types/InstEnv.lhs
@@
-322,7
+322,13
@@
lookup_inst_env env key_cls key_tys key_all_tvs
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 tcUnifyTys bind_fn tpl key_tys of
+ -> ASSERT2( not (tyVarsOfTypes key_tys `intersectsVarSet` tpl_tyvars),
+ (ppr key_cls <+> ppr key_tys <+> ppr key_all_tvs) $$
+ (ppr dfun_id <+> ppr tpl_tyvars <+> ppr tpl)
+ )
+ -- Unification will break badly if the variables overlap
+ -- They shouldn't because we allocate separate uniques for them
+ case tcUnifyTys bind_fn tpl key_tys 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