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:
fd92738
)
Make warnings come out in deterministic order
author
simonpj@microsoft.com
<unknown>
Wed, 3 Jan 2007 10:24:38 +0000
(10:24 +0000)
committer
simonpj@microsoft.com
<unknown>
Wed, 3 Jan 2007 10:24:38 +0000
(10:24 +0000)
Fixes Trac #1053
compiler/typecheck/TcInstDcls.lhs
patch
|
blob
|
history
diff --git
a/compiler/typecheck/TcInstDcls.lhs
b/compiler/typecheck/TcInstDcls.lhs
index
fe7b1d8
..
da18ef1
100644
(file)
--- a/
compiler/typecheck/TcInstDcls.lhs
+++ b/
compiler/typecheck/TcInstDcls.lhs
@@
-274,11
+274,11
@@
tcLocalInstDecl1 decl@(L loc (InstDecl poly_ty binds uprags ats))
checkValidAndMissingATs clas inst_tys ats
= do { -- Issue a warning for each class AT that is not defined in this
-- instance.
checkValidAndMissingATs clas inst_tys ats
= do { -- Issue a warning for each class AT that is not defined in this
-- instance.
- ; let classDefATs = listToNameSet . map tyConName . classATs $ clas
- definedATs = listToNameSet . map (tcdName.unLoc.fst) $ ats
- omitted = classDefATs `minusNameSet` definedATs
+ ; let class_ats = map tyConName (classATs clas)
+ defined_ats = listToNameSet . map (tcdName.unLoc.fst) $ ats
+ omitted = filterOut (`elemNameSet` defined_ats) class_ats
; warn <- doptM Opt_WarnMissingMethods
; warn <- doptM Opt_WarnMissingMethods
- ; mapM_ (warnTc warn . omittedATWarn) (nameSetToList omitted)
+ ; mapM_ (warnTc warn . omittedATWarn) omitted
-- Ensure that all AT indexes that correspond to class parameters
-- coincide with the types in the instance head. All remaining
-- Ensure that all AT indexes that correspond to class parameters
-- coincide with the types in the instance head. All remaining