From 6c936babdfb7f9c229b1d01be35728e2caf1d53d Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 29 Jan 2001 08:41:09 +0000 Subject: [PATCH] [project @ 2001-01-29 08:41:09 by simonpj] Check class decls for validity only for source-code, not iface decls --- ghc/compiler/typecheck/TcClassDcl.lhs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs index 5999c9f..cf01b50 100644 --- a/ghc/compiler/typecheck/TcClassDcl.lhs +++ b/ghc/compiler/typecheck/TcClassDcl.lhs @@ -115,9 +115,6 @@ tcClassDecl1 is_rec rec_env -- or if we're looking at an interface file decl in -- (in which case def_methods = Nothing - checkTc (gla_exts || length tyvar_names == 1) - (classArityErr class_name) `thenTc_` - -- LOOK THINGS UP IN THE ENVIRONMENT tcLookupClass class_name `thenTc` \ clas -> let @@ -130,8 +127,14 @@ tcClassDecl1 is_rec rec_env -- SOURCE-CODE CONSISTENCY CHECKS (case def_methods of - Nothing -> returnTc Nothing -- Not source - Just dms -> checkDefaultBinds clas op_names dms `thenTc` \ dm_env -> + Nothing -> -- Not source + returnTc Nothing + + Just dms -> -- Source so do error checks + checkTc (gla_exts || length tyvar_names == 1) + (classArityErr class_name) `thenTc_` + + checkDefaultBinds clas op_names dms `thenTc` \ dm_env -> checkGenericClassIsUnary clas dm_env `thenTc_` returnTc (Just dm_env) ) `thenTc` \ mb_dm_env -> -- 1.7.10.4