diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2018-12-03 07:03:44 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-12-03 07:03:44 -0500 |
commit | 75a8349b2a7d0142d3d687837caf5a95bbb4368d (patch) | |
tree | 7a1c14b1ba4357dcc032d2d32a10039b8c3f1cd0 /docs | |
parent | 93a3f9070d5d69ad6a28fe94ccccd20c54609698 (diff) | |
download | haskell-75a8349b2a7d0142d3d687837caf5a95bbb4368d.tar.gz |
Warn on all out-of-range literals in pats/exprs
Summary:
These changes were motivated by #13256. While poking around, I
realized we weren't very consistent in our "-Woverflowed-literals"
warnings. This patch fixes that by:
* warning earlier on in the pipeline (ie. before we've desugared
'Int' patterns into 'I# Int#')
* handling 'HsLit' as well as 'HsOverLit' (this covers unboxed
literals)
* covering more pattern / expression forms
4/6 of the warnings in the 'Overflow' test are due to this patch. The
other two are mostly for completeness.
Also fixed a missing empty-enumeration warning for 'Natural'.
This warnings were tripped up by the 'Bounded Word' instance (see #9505),
but the fix was obvious and simple: use unboxed word literals.
Test Plan: make TEST=Overflow && make TEST=T10930
Reviewers: hvr, bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, carter
GHC Trac Issues: #13256, #10930
Differential Revision: https://phabricator.haskell.org/D5181
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/8.8.1-notes.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index 6f6404e736..c98c7e386c 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -64,6 +64,11 @@ Language For instance, it is now permissible to write ``Proxy '(a :: A, b :: B)`` (previous GHC versions required extra parens: ``Proxy '((a :: A), (b :: B))``). +- :ghc-flag:`-Woverflowed-literals` checks all literals. Previously, it would + only inspect boxed expression literals. + +- :ghc-flag:`-Wempty-enumerations` now also works for ``Numeric.Natural``. + Compiler ~~~~~~~~ |