diff options
Diffstat (limited to 'compiler/hsSyn/HsUtils.hs')
-rw-r--r-- | compiler/hsSyn/HsUtils.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index f409c2a7d2..97ab76f986 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -146,7 +146,8 @@ mkSimpleMatch :: HsMatchContext (NameOrRdrName (IdP id)) -> LMatch id (Located (body id)) mkSimpleMatch ctxt pats rhs = L loc $ - Match ctxt pats Nothing (unguardedGRHSs rhs) + Match { m_ctxt = ctxt, m_pats = pats, m_type = Nothing + , m_grhss = unguardedGRHSs rhs } where loc = case pats of [] -> getLoc rhs @@ -766,8 +767,10 @@ mkPrefixFunRhs n = FunRhs { mc_fun = n mkMatch :: HsMatchContext (NameOrRdrName (IdP p)) -> [LPat p] -> LHsExpr p -> Located (HsLocalBinds p) -> LMatch p (LHsExpr p) mkMatch ctxt pats expr lbinds - = noLoc (Match ctxt (map paren pats) Nothing - (GRHSs (unguardedRHS noSrcSpan expr) lbinds)) + = noLoc (Match { m_ctxt = ctxt + , m_pats = map paren pats + , m_type = Nothing + , m_grhss = GRHSs (unguardedRHS noSrcSpan expr) lbinds }) where paren lp@(L l p) | hsPatNeedsParens p = L l (ParPat lp) | otherwise = lp |