From: Manuel M T Chakravarty Date: Tue, 21 Oct 2008 13:17:21 +0000 (+0000) Subject: Reject programs with superclass equalities for now X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=52d22b94d7c3a71f584ce71c057a86ab9826da41;p=ghc-hetmet.git Reject programs with superclass equalities for now - The current implementation of type families cannot properly deal with superclass equalities. Instead of making a half-hearted attempt at supporting them, which mostly ends in cryptic error message, rejecting right away with an appropriate message. MERGE TO 6.10 --- diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index 543c61c..6de3dd2 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -1322,6 +1322,14 @@ check_pred_ty dflags ctxt pred@(ClassP cls tys) arity_err = arityErr "Class" class_name arity n_tys how_to_allow = parens (ptext (sLit "Use -XFlexibleContexts to permit this")) +check_pred_ty _ (ClassSCCtxt _) (EqPred _ _) + = -- We do not yet support superclass equalities. + failWithTc $ + sep [ ptext (sLit "The current implementation of type families does not") + , ptext (sLit "support equality constraints in superclass contexts.") + , ptext (sLit "They are planned for a future release.") + ] + check_pred_ty dflags _ pred@(EqPred ty1 ty2) = do { -- Equational constraints are valid in all contexts if type -- families are permitted