Commit 67aacde3 authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu

Fix Trac #8028.

Check for an empty list of equations when converting
a closed type family from TH to an HsDecl.
parent 1ae72ac4
......@@ -251,10 +251,13 @@ cvtDec (TySynInstD tc eqn)
, tfid_fvs = placeHolderNames } } }
cvtDec (ClosedTypeFamilyD tc tyvars mkind eqns)
| not $ null eqns
= do { (_, tc', tvs') <- cvt_tycl_hdr [] tc tyvars
; mkind' <- cvtMaybeKind mkind
; eqns' <- mapM (cvtTySynEqn tc') eqns
; returnL $ TyClD (FamDecl (FamilyDecl (ClosedTypeFamily eqns') tc' tvs' mkind')) }
| otherwise
= failWith (ptext (sLit "Illegal empty closed type family"))
----------------
cvtTySynEqn :: Located RdrName -> TySynEqn -> CvtM (LTyFamInstEqn RdrName)
cvtTySynEqn tc (TySynEqn lhs rhs)
......
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