diff options
Diffstat (limited to 'compiler/rename/RnExpr.hs')
-rw-r--r-- | compiler/rename/RnExpr.hs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs index b74b557f49..dd38feb367 100644 --- a/compiler/rename/RnExpr.hs +++ b/compiler/rename/RnExpr.hs @@ -2100,11 +2100,6 @@ badIpBinds what binds --------- -lookupSyntaxMonadFailOpName :: Bool -> RnM (SyntaxExpr GhcRn, FreeVars) -lookupSyntaxMonadFailOpName monadFailEnabled - | monadFailEnabled = lookupSyntaxName failMName - | otherwise = lookupSyntaxName failMName_preMFP - monadFailOp :: LPat GhcPs -> HsStmtContext Name -> RnM (SyntaxExpr GhcRn, FreeVars) @@ -2146,14 +2141,14 @@ So, in this case, we synthesize the function -} getMonadFailOp :: RnM (SyntaxExpr GhcRn, FreeVars) -- Syntax expr fail op getMonadFailOp - = do { xMonadFailEnabled <- fmap (xopt LangExt.MonadFailDesugaring) getDynFlags - ; xOverloadedStrings <- fmap (xopt LangExt.OverloadedStrings) getDynFlags + = do { xOverloadedStrings <- fmap (xopt LangExt.OverloadedStrings) getDynFlags ; xRebindableSyntax <- fmap (xopt LangExt.RebindableSyntax) getDynFlags - ; reallyGetMonadFailOp xRebindableSyntax xOverloadedStrings xMonadFailEnabled } + ; reallyGetMonadFailOp xRebindableSyntax xOverloadedStrings + } where - reallyGetMonadFailOp rebindableSyntax overloadedStrings monadFailEnabled + reallyGetMonadFailOp rebindableSyntax overloadedStrings | rebindableSyntax && overloadedStrings = do - (failExpr, failFvs) <- lookupSyntaxMonadFailOpName monadFailEnabled + (failExpr, failFvs) <- lookupSyntaxName failMName (fromStringExpr, fromStringFvs) <- lookupSyntaxName fromStringName let arg_lit = fsLit "arg" arg_name = mkSystemVarName (mkVarOccUnique arg_lit) arg_lit @@ -2167,4 +2162,4 @@ getMonadFailOp let failAfterFromStringSynExpr :: SyntaxExpr GhcRn = mkSyntaxExpr failAfterFromStringExpr return (failAfterFromStringSynExpr, failFvs `plusFV` fromStringFvs) - | otherwise = lookupSyntaxMonadFailOpName monadFailEnabled + | otherwise = lookupSyntaxName failMName |