Skip to content

ExtendedDefaultRules-related regression in GHC 8.0.2

Commit https://git.haskell.org/ghc.git/commit/9a34bf1985035858ece043bf38b47b6ff4b88efb introduced a regression between GHC 8.0.1 and 8.0.2 regarding the behavior of ExtendedDefaultRules. In GHC 8.0.1, this program

module Bug where

default (Bool)

would compile without issue. On GHC 8.0.2, however, it is rejected with this error message:

$ /opt/ghc/8.0.2/bin/ghc Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:3:1: error:
    • The default type ‘Bool’ is not an instance of ‘Num’
    • When checking the types in a default declaration

As a result, the shelly library now fails to compile with GHC 8.0.2 (see https://github.com/yesodweb/Shelly.hs/issues/130). A workaround is to explicitly enable ExtendedDefaultRules at the top of the module.

Richard, do you understand what's going on here? I'm not sure if this is a real regression or just GHC being more particular (admittedly, I don't understand many of the intricacies of ExtendedDefaultRules).

Trac metadata
Trac field Value
Version 8.0.2-rc1
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information