From c054162ae151ff82d43e504836784a7bc7827d9f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sat, 7 Apr 2018 13:32:58 -0400 Subject: Revert "Fix #14838 by marking TH-spliced code as FromSource" This reverts commit ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383. Due to #14987. Reviewers: goldfire, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, thomie, carter GHC Trac Issues: #14987, #14838 Differential Revision: https://phabricator.haskell.org/D4545 --- compiler/parser/RdrHsSyn.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/parser/RdrHsSyn.hs') diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 68d152e62e..a976d08558 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -422,7 +422,7 @@ getMonoBind (L loc1 (FunBind { fun_id = fun_id1@(L _ f1), = let doc_decls' = doc_decl : doc_decls in go mtchs (combineSrcSpans loc loc2) binds doc_decls' go mtchs loc binds doc_decls - = ( L loc (makeFunBind FromSource fun_id1 (reverse mtchs)) + = ( L loc (makeFunBind fun_id1 (reverse mtchs)) , (reverse doc_decls) ++ binds) -- Reverse the final matches, to get it back in the right order -- Do the same thing with the trailing doc comments @@ -1077,7 +1077,7 @@ checkFunBind msg strictness ann lhs_loc fun is_infix pats (L rhs_span grhss) let match_span = combineSrcSpans lhs_loc rhs_span -- Add back the annotations stripped from any HsPar values in the lhs -- mapM_ (\a -> a match_span) ann - return (ann, makeFunBind FromSource fun + return (ann, makeFunBind fun [L match_span (Match { m_ctxt = FunRhs { mc_fun = fun , mc_fixity = is_infix , mc_strictness = strictness } @@ -1086,12 +1086,12 @@ checkFunBind msg strictness ann lhs_loc fun is_infix pats (L rhs_span grhss) -- The span of the match covers the entire equation. -- That isn't quite right, but it'll do for now. -makeFunBind :: Origin -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] +makeFunBind :: Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> HsBind GhcPs -- Like HsUtils.mkFunBind, but we need to be able to set the fixity too -makeFunBind origin fn ms +makeFunBind fn ms = FunBind { fun_id = fn, - fun_matches = mkMatchGroup origin ms, + fun_matches = mkMatchGroup FromSource ms, fun_co_fn = idHsWrapper, bind_fvs = placeHolderNames, fun_tick = [] } -- cgit v1.2.1