class Foo a where foo :: a y :: Double y = y x = if True then foo else y -- 8:18-8:21: There is no instance for .