summaryrefslogtreecommitdiff
path: root/ghc/compiler/rename/RnEnv.lhs
diff options
context:
space:
mode:
authorsof <unknown>2001-12-07 07:37:43 +0000
committersof <unknown>2001-12-07 07:37:43 +0000
commit2427987977bc68edacd7b552909bfdb264884b85 (patch)
tree34c8fb551286b9bb7232dd5b7b37699892897fab /ghc/compiler/rename/RnEnv.lhs
parent8408f31662e0db548650b3aacff39a324cb9e296 (diff)
downloadhaskell-2427987977bc68edacd7b552909bfdb264884b85.tar.gz
[project @ 2001-12-07 07:37:43 by sof]
Tidyup - previous instance-decl commit fell a bit short: * RnEnv.lookupInstDeclBndr unceremoniously fell over when passed an out-of-scope class name. * the AvailEnv carried around didn't common up type/class info (i.e., AvailTCs), but rather type/class and method/label names, causing the renamer to (semi)randomly report instance methods as being out-of-scope in the presence of multiple imports for a module. * didn't support 'hiding' of class / method names (for the purposes of checking instance decls).
Diffstat (limited to 'ghc/compiler/rename/RnEnv.lhs')
-rw-r--r--ghc/compiler/rename/RnEnv.lhs3
1 files changed, 3 insertions, 0 deletions
diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs
index a7fd614386..affbcc9e91 100644
--- a/ghc/compiler/rename/RnEnv.lhs
+++ b/ghc/compiler/rename/RnEnv.lhs
@@ -258,6 +258,9 @@ lookupInstDeclBndr cls_name rdr_name
| otherwise
= getGlobalAvails `thenRn` \ avail_env ->
case lookupNameEnv avail_env cls_name of
+ -- class not in scope; don't fail as later checks will catch this,
+ -- but just return (bogus) name. Icky.
+ Nothing -> returnRn (mkUnboundName rdr_name)
Just (AvailTC _ ns) -> case [n | n <- ns, nameOccName n == occ] of
(n:ns)-> ASSERT( null ns ) returnRn n
[] -> failWithRn (mkUnboundName rdr_name)