Import GHC.Err so we see bottoming functions properly
authorsimonpj@microsoft.com <unknown>
Fri, 3 Apr 2009 09:11:18 +0000 (09:11 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 3 Apr 2009 09:11:18 +0000 (09:11 +0000)
commit95087a4ef4877a0860331cac2eafab481158bd60
tree293b300ac8456516a6788ea77f6631e775dc5880
parent452a2cd9db35d5ec8768e71bc6ccb930e4fc139b
Import GHC.Err so we see bottoming functions properly

Before this patch, GHC/Err.lhs-boot exported divZeroError and overflowError,
as well as plain 'error'.  The latter has a wired-in defn in GHC (MkId.lhs),
but the former two do not.  As a result GHC doesn't see that overflowError
is a bottoming function at a crucial moment when compiling GHC.Real, and
that means that divMod wasn't getting the CPR property.

The fix is easy:
  - GHC/Err.lhs-boot should export only 'error'

  - GHC.Real, GHC.Int, and GHC.Word should import GHC.Err
    directly.  They can do this nowadays without creating
    a module loop, thanks to the new exception story
GHC/Err.lhs-boot
GHC/Int.hs
GHC/Real.lhs
GHC/Word.hs