Skip to content

Commit

Permalink
Fix Trac #8028.
Browse files Browse the repository at this point in the history
Check for an empty list of equations when converting
a closed type family from TH to an HsDecl.
  • Loading branch information
Richard Eisenberg committed Jul 2, 2013
1 parent 1ae72ac commit 67aacde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/hsSyn/Convert.lhs
Expand Up @@ -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)
Expand Down

0 comments on commit 67aacde

Please sign in to comment.