Ticket #2854 (closed bug: duplicate)
Extended defaulting rules not used for super classes
Description
Consider the following module
{-# LANGUAGE ExtendedDefaultRules #-}
module Bug4 where
class (Num a) => C a where
f :: a -> a
instance C Integer where
f = (+1)
x = show (f 5)
The type of x is
x :: (C a) => String
and since a is ambiguous the defaulting rules should be used. Since Num is a superclass of C the type variable should be defaulted to Integer. But instead we get an error.
Removing the Num superclass of C makes it work, since the type of x is
x ::: (Num a, C a) => String
and the defaulting kicks in as expected.
Change History
Note: See
TracTickets for help on using
tickets.
