summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj <unknown>2000-04-20 16:31:47 +0000
committersimonpj <unknown>2000-04-20 16:31:47 +0000
commit8f674b1c9bc152363650adb609f07b695eb9ecf2 (patch)
tree0c1ff4d3a7d20c9b82ccd418a7d1a4e4e8785b12
parentc5b20ebe40851da1bdff06a60ff1416a78f6bce5 (diff)
downloadhaskell-8f674b1c9bc152363650adb609f07b695eb9ecf2.tar.gz
[project @ 2000-04-20 16:31:47 by simonpj]
Finish TcClassDecl
-rw-r--r--ghc/compiler/typecheck/TcClassDcl.lhs12
1 files changed, 3 insertions, 9 deletions
diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs
index 4018eb3155..efc05e1aa0 100644
--- a/ghc/compiler/typecheck/TcClassDcl.lhs
+++ b/ghc/compiler/typecheck/TcClassDcl.lhs
@@ -242,7 +242,7 @@ tcClassContext class_name rec_class rec_tyvars context sc_sel_names
let
sc_theta' = classesOfPreds sc_theta
sc_tys = mkDictTys sc_theta'
- sc_sel_ids = zipWithEqual "tcClassContext" mk_super_id sc_sel_names sc_tys
+ sc_sel_ids = [mkDictSelId sc_name rec_class | sc_name <- sc_sel_names]
in
-- Done
returnTc (sc_theta', sc_tys, sc_sel_ids)
@@ -250,14 +250,8 @@ tcClassContext class_name rec_class rec_tyvars context sc_sel_names
where
rec_tyvar_tys = mkTyVarTys rec_tyvars
- mk_super_id name dict_ty
- = mkDictSelId name rec_class {- SUP:??? ty
- where
- ty = mkForAllTys rec_tyvars $
- mkFunTy (mkDictTy rec_class rec_tyvar_tys) dict_ty -}
-
check_constraint (HsPClass c tys) = checkTc (all is_tyvar tys)
- (superClassErr class_name (c, tys))
+ (superClassErr class_name (c, tys))
is_tyvar (MonoTyVar _) = True
is_tyvar other = False
@@ -289,7 +283,7 @@ tcClassSig rec_env rec_clas rec_clas_tyvars
local_ty
-- Build the selector id and default method id
- sel_id = mkDictSelId op_name rec_clas {- SUP:??? global_ty -}
+ sel_id = mkDictSelId op_name rec_clas
dm_id = mkDefaultMethodId dm_name rec_clas global_ty
final_dm_id = tcAddImportedIdInfo rec_env dm_id
in