diff options
author | nineonine <mail4chemik@gmail.com> | 2019-10-07 13:45:29 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-13 06:31:40 -0400 |
commit | 5ab1a28d91e2e5331bf20b1e3dc0dff793ebca8b (patch) | |
tree | b3895afbc4efd028c0bc0a0f224461d2e9c4a3a4 /compiler/GHC/ThToHs.hs | |
parent | 226d86d29842f894869e23ddb1197d04dacae7f7 (diff) | |
download | haskell-5ab1a28d91e2e5331bf20b1e3dc0dff793ebca8b.tar.gz |
Template Haskell: make unary tuples legal (#16881)
Diffstat (limited to 'compiler/GHC/ThToHs.hs')
-rw-r--r-- | compiler/GHC/ThToHs.hs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs index f49d6ff0b2..8c3e6a5f1e 100644 --- a/compiler/GHC/ThToHs.hs +++ b/compiler/GHC/ThToHs.hs @@ -1368,12 +1368,7 @@ cvtTypeKind ty_str ty TupleT n | Just normals <- m_normals , normals `lengthIs` n -- Saturated - -> if n==1 then return (head normals) -- Singleton tuples treated - -- like nothing (ie just parens) - else returnL (HsTupleTy noExtField - HsBoxedOrConstraintTuple normals) - | n == 1 - -> failWith (ptext (sLit ("Illegal 1-tuple " ++ ty_str ++ " constructor"))) + -> returnL (HsTupleTy noExtField HsBoxedOrConstraintTuple normals) | otherwise -> mk_apps (HsTyVar noExtField NotPromoted (noLoc (getRdrName (tupleTyCon Boxed n)))) @@ -1491,8 +1486,6 @@ cvtTypeKind ty_str ty -- Promoted data constructor; hence cName PromotedTupleT n - | n == 1 - -> failWith (ptext (sLit ("Illegal promoted 1-tuple " ++ ty_str))) | Just normals <- m_normals , normals `lengthIs` n -- Saturated -> returnL (HsExplicitTupleTy noExtField normals) |