Warning about Unsafe inference is missing a reason
If I write
{-# LANGUAGE TypeFamilies, EmptyCase #-}
module Bug where
import GHC.Generics
data T
instance Generic T where
type Rep T = V1
from x = case x of
to x = case x of
and compile with -Wunsafe
, I get
rae:14:34:10 ~/temp> ghc -Wunsafe Bug.hs
Loaded package environment from /Users/rae/.ghc/x86_64-darwin-8.10.1/environments/default
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
on the commandline: warning: [-Wunsafe]
‘Bug’ has been inferred as unsafe!
Reason:
rae:14:34:14 ~/temp>
Note: nothing after Reason:
.
This is because recordUnsafeInfer
is sometimes called with an empty bag of messages, which should probably be disallowed.