diff options
Diffstat (limited to 'compiler/GHC/Parser/PostProcess.hs')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index 645f56fc54..018ce7bb60 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -115,7 +115,7 @@ import GHC.Types.Name import GHC.Types.Basic import GHC.Parser.Lexer import GHC.Utils.Lexeme ( isLexCon ) -import GHC.Core.Type ( TyThing(..), funTyCon, Specificity(..) ) +import GHC.Core.Type ( TyThing(..), unrestrictedFunTyCon, Specificity(..) ) import GHC.Builtin.Types( cTupleTyConName, tupleTyCon, tupleDataCon, nilDataConName, nilDataConKey, listTyConName, listTyConKey, eqTyCon_RDR, @@ -710,7 +710,7 @@ mkGadtDecl names ty where mb_record_gadt ty | (mtvs, mcxt, body_ty) <- splitLHsGADTPrefixTy ty - , L _ (HsFunTy _ (L loc (HsRecTy _ rf)) res_ty) <- body_ty + , L _ (HsFunTy _ _w (L loc (HsRecTy _ rf)) res_ty) <- body_ty = Just (mtvs, mcxt, RecCon (L loc rf), res_ty) | otherwise = Nothing @@ -1650,7 +1650,7 @@ mergeDataCon all_xs = goFirst [L l (TyElOpd (HsTupleTy _ HsBoxedOrConstraintTuple ts))] = return ( pure () , ( L l (getRdrName (tupleDataCon Boxed (length ts))) - , PrefixCon ts + , PrefixCon (map hsLinear ts) , mTrailingDoc ) ) goFirst ((L l (TyElOpd t)):xs) | (_, t', addAnns, xs') <- pBangTy (L l t) xs @@ -1662,7 +1662,7 @@ mergeDataCon all_xs = go addAnns mLastDoc ts [ L l (TyElOpd (HsTyVar _ _ (L _ tc))) ] = do { data_con <- tyConToDataCon l tc - ; return (addAnns, (data_con, PrefixCon ts, mkConDoc mLastDoc)) } + ; return (addAnns, (data_con, PrefixCon (map hsLinear ts), mkConDoc mLastDoc)) } go addAnns mLastDoc ts ((L l (TyElDocPrev doc)):xs) = go addAnns (mLastDoc `mplus` Just (L l doc)) ts xs go addAnns mLastDoc ts ((L l (TyElOpd t)):xs) @@ -1697,7 +1697,7 @@ mergeDataCon all_xs = ; let rhs = mkLHsDocTyMaybe rhs_t trailingFieldDoc lhs = mkLHsDocTyMaybe lhs_t mLhsDoc addAnns = lhs_addAnns >> rhs_addAnns - ; return (addAnns, (op, InfixCon lhs rhs, mkConDoc mOpDoc)) } + ; return (addAnns, (op, InfixCon (hsLinear lhs) (hsLinear rhs), mkConDoc mOpDoc)) } where malformedErr = ( foldr combineSrcSpans noSrcSpan (map getLoc all_xs') @@ -2565,8 +2565,9 @@ checkPrecP (L l (_,i)) (L _ ol) | all specialOp ol = pure () | otherwise = addFatalError l (text ("Precedence out of range: " ++ show i)) where + -- If you change this, consider updating Note [Fixity of (->)] in GHC/Types.hs specialOp op = unLoc op `elem` [ eqTyCon_RDR - , getRdrName funTyCon ] + , getRdrName unrestrictedFunTyCon ] mkRecConstrOrUpdate :: LHsExpr GhcPs |