Commit bd0ff2bb authored by simonpj's avatar simonpj
Browse files

[project @ 2000-07-18 08:08:35 by simonpj]

Remove dead code: checkConstraints and univErr
parent 5f0c89e0
......@@ -656,26 +656,6 @@ rnHsTupConWkr (HsTupCon n boxity)
-- 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)
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)]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment