Incorrect warning when exporting a named default and the class
Consider this program
{-# LANGUAGE NamedDefaults #-}
module A (
Stringify(..),
default Stringify
) where
class Stringify a where
stringify :: a -> String
instance Stringify Int where
stringify n = "Int: " ++ show n
instance Stringify Bool where
stringify b = "Bool: " ++ show b
instance Stringify [Char] where
stringify s = "String: " ++ s
default Stringify (Int)
compile the module with oneshot mode (-c
), by default you get the incorrect warning
[matt@nixos:~/ghc-interface]$ ghc -c A.hs
A.hs:4:5: warning: [GHC-47854] [-Wduplicate-exports]
‘Stringify’ is exported by ‘default Stringify’ and ‘Stringify(..)’
|
4 | default Stringify
| ^^^^^^^^^^^^^^^^^
Edited by sheaf