Commit 776e62ba authored by simonpj's avatar simonpj
Browse files

drv015 should fial

parent ce9b6345
......@@ -12,5 +12,5 @@ test('drv011', normal, compile, [''])
test('drv012', normal, compile, [''])
test('drv013', normal, compile, [''])
test('drv014', normal, compile, [''])
test('drv015', normal, compile, [''])
test('drv015', normal, compile_fail, [''])
test('drv020', normal, compile, [''])
{-# OPTIONS -fglasgow-exts #-}
-- July 07: I'm changing this from "should_compile" to "should_fail".
-- It would generate an instance decl like
-- insance (Show (f a), Show (g a)) => Show (Pair1 f g a)
-- and that is not Haskell 98.
--
-- See Note [Exotic derived instance contexts] in TcSimplify.
-- The rule is simple: the context of a derived instance decl must
-- contain constraints of form (C tyvar) only, just as H98.
module ShouldCompile where
newtype Pair1 f g a = Pair1 {unPair1 :: (f a, g a)}
......
drv015.hs:14:0:
No instances for (Show (g a), Show (f a))
arising from the 'deriving' clause of a data type declaration
at drv015.hs:(14,0)-(15,25)
Possible fix:
add an instance declaration for (Show (g a), Show (f a))
When deriving the instance for (Show (Pair1 f g a))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment