diff options
author | Nolan <nolane16@gmail.com> | 2017-05-08 17:46:22 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-05-08 17:46:24 -0400 |
commit | 0279b745c29213c479b61f864ca5d3d2ae76ac77 (patch) | |
tree | 6f5fb39ddcdb142f017e9196ddc480971eb661ae /compiler/rename/RnExpr.hs | |
parent | dc3b4af6d0c38ced4f0becf575474a1c1b08f794 (diff) | |
download | haskell-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.hs | 7 |
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 |