Fix #15502 by not casting to Int during TH conversion
Summary: When turning an `IntegerL` to an `IntegralLit` during TH conversion, we were stupidly casting an `Integer` to an `Int` in order to determine how it should be pretty-printed. Unsurprisingly, this causes problems when the `Integer` doesn't lie within the bounds of an `Int`, as demonstrated in #15502. The fix is simple: don't cast to an `Int`. Test Plan: make test TEST=T15502 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15502 Differential Revision: https://phabricator.haskell.org/D5089
Showing
- compiler/basicTypes/BasicTypes.hs 12 additions, 2 deletionscompiler/basicTypes/BasicTypes.hs
- testsuite/tests/th/T15502.hs 9 additions, 0 deletionstestsuite/tests/th/T15502.hs
- testsuite/tests/th/T15502.stderr 4 additions, 0 deletionstestsuite/tests/th/T15502.stderr
- testsuite/tests/th/all.T 1 addition, 0 deletionstestsuite/tests/th/all.T
Loading
Please register or sign in to comment