summaryrefslogtreecommitdiff
path: root/compiler/rename/RnExpr.hs
diff options
context:
space:
mode:
authorNolan <nolane16@gmail.com>2017-05-08 17:46:22 -0400
committerBen Gamari <ben@smart-cactus.org>2017-05-08 17:46:24 -0400
commit0279b745c29213c479b61f864ca5d3d2ae76ac77 (patch)
tree6f5fb39ddcdb142f017e9196ddc480971eb661ae /compiler/rename/RnExpr.hs
parentdc3b4af6d0c38ced4f0becf575474a1c1b08f794 (diff)
downloadhaskell-0279b745c29213c479b61f864ca5d3d2ae76ac77.tar.gz
Make XNegativeLiterals treat -0.0 as negative 0
Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, mpickering GHC Trac Issues: #13211 Differential Revision: https://phabricator.haskell.org/D3543
Diffstat (limited to 'compiler/rename/RnExpr.hs')
-rw-r--r--compiler/rename/RnExpr.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs
index 987b0bec49..154e270b5a 100644
--- a/compiler/rename/RnExpr.hs
+++ b/compiler/rename/RnExpr.hs
@@ -152,8 +152,11 @@ rnExpr (HsLit lit)
; return (HsLit lit, emptyFVs) }
rnExpr (HsOverLit lit)
- = do { (lit', fvs) <- rnOverLit lit
- ; return (HsOverLit lit', fvs) }
+ = do { ((lit', mb_neg), fvs) <- rnOverLit lit -- See Note [Negative zero]
+ ; case mb_neg of
+ Nothing -> return (HsOverLit lit', fvs)
+ Just neg -> return ( HsApp (noLoc neg) (noLoc (HsOverLit lit'))
+ , fvs ) }
rnExpr (HsApp fun arg)
= do { (fun',fvFun) <- rnLExpr fun