From bd0ff2bbda2b3f15dd52516082bf5f4ee1c11966 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 18 Jul 2000 08:08:35 +0000 Subject: [PATCH] [project @ 2000-07-18 08:08:35 by simonpj] Remove dead code: checkConstraints and univErr --- ghc/compiler/rename/RnSource.lhs | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/ghc/compiler/rename/RnSource.lhs b/ghc/compiler/rename/RnSource.lhs index 260b9c6..b458ed8 100644 --- a/ghc/compiler/rename/RnSource.lhs +++ b/ghc/compiler/rename/RnSource.lhs @@ -656,26 +656,6 @@ rnHsTupConWkr (HsTupCon n boxity) \end{code} \begin{code} --- Check that each constraint mentions at least one of the forall'd type variables --- Since the forall'd type variables are a subset of the free tyvars --- of the tau-type part, this guarantees that every constraint mentions --- at least one of the free tyvars in ty -checkConstraints doc forall_tyvars tau_vars ctxt ty - = mapRn (checkPred doc forall_tyvars ty) ctxt `thenRn` \ maybe_ctxt' -> - returnRn (catMaybes maybe_ctxt') - -- Remove problem ones, to avoid duplicate error message. - -checkPred doc forall_tyvars ty p@(HsPClass clas tys) - | not_univ = failWithRn Nothing (univErr doc p ty) - | otherwise = returnRn (Just p) - where - ct_vars = extractHsTysRdrTyVars tys - not_univ = -- At least one of the tyvars in each constraint must - -- be universally quantified. This restriction isn't in Hugs - not (any (`elem` forall_tyvars) ct_vars) -checkPred doc forall_tyvars ty p@(HsPIParam _ _) - = returnRn (Just p) - rnForAll doc forall_tyvars ctxt ty = bindTyVarsFVRn doc forall_tyvars $ \ new_tyvars -> rnContext doc ctxt `thenRn` \ (new_ctxt, cxt_fvs) -> @@ -952,15 +932,6 @@ forAllErr doc ty tyvar $$ (ptext SLIT("In") <+> doc)) -univErr doc constraint ty - = sep [ptext SLIT("All of the type variable(s) in the constraint") - <+> quotes (ppr constraint) - <+> ptext SLIT("are already in scope"), - nest 4 (ptext SLIT("At least one must be universally quantified here")) - ] - $$ - (ptext SLIT("In") <+> doc) - badRuleLhsErr name lhs = sep [ptext SLIT("Rule") <+> ptext name <> colon, nest 4 (ptext SLIT("Illegal left-hand side:") <+> ppr lhs)] -- 1.7.10.4