Fix isValidNatural: The BigNat in NatJ# must have at least 2 limbs
authorSimon Jakobi <simon.jakobi@gmail.com>
Tue, 4 Jun 2019 00:54:35 +0000 (02:54 +0200)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Fri, 7 Jun 2019 14:25:16 +0000 (10:25 -0400)
commitbe63d2996308c77f8a0a44592074c98f66a80e93
treea909f8ac110302edb84e70c4c7b2073209588037
parent9bb58799d2ce58f6aef772df79ad26210403aded
Fix isValidNatural: The BigNat in NatJ# must have at least 2 limbs

Previously the `integer-gmp` variant of `isValidNatural` would fail to
detect values `<= maxBound::Word` that were incorrectly encoded using
the `NatJ#` constructor.
libraries/base/GHC/Natural.hs
libraries/base/changelog.md
libraries/base/tests/all.T
libraries/base/tests/isValidNatural.hs [new file with mode: 0644]
libraries/base/tests/isValidNatural.stdout [new file with mode: 0644]
libraries/integer-gmp/src/GHC/Integer/Type.hs