Valid hole fits and -XExtendedDefaultRules don't get along
If I say
{-# LANGUAGE ExtendedDefaultRules #-}
module Bug where
blah :: Show a => a -> String
blah x = show _
I get
Bug.hs:6:15: error:
• Found hole: _ :: ()
• In the first argument of ‘show’, namely ‘_’
In the expression: show _
In an equation for ‘blah’: blah x = show _
• Relevant bindings include
x :: a (bound at Bug.hs:6:6)
blah :: a -> String (bound at Bug.hs:6:1)
Constraints include Show a (from Bug.hs:5:1-29)
Valid hole fits include
() :: () (bound at <wired into compiler>)
mempty :: forall a. Monoid a => a
with mempty @()
(imported from ‘Prelude’ at Bug.hs:3:8-10
(and originally defined in ‘GHC.Base’))
maxBound :: forall a. Bounded a => a
with maxBound @()
(imported from ‘Prelude’ at Bug.hs:3:8-10
(and originally defined in ‘GHC.Enum’))
minBound :: forall a. Bounded a => a
with minBound @()
(imported from ‘Prelude’ at Bug.hs:3:8-10
(and originally defined in ‘GHC.Enum’))
|
6 | blah x = show _
|
Note that GHC ends up unifying the type of _
with ()
, and then suggests variables that can have type ()
.