Commit a404d9ae authored by simonpj's avatar simonpj
Browse files

[project @ 2003-04-08 11:48:15 by simonpj]

Add newtype deriving error-msg tests
parent c43c29e4
......@@ -7,3 +7,4 @@ test('drvfail005', normal, compile_fail, [''])
test('drvfail006', normal, compile_fail, [''])
test('drvfail007', normal, compile_fail, [''])
test('drvfail008', normal, compile_fail, [''])
test('drvfail009', normal, compile_fail, [''])
{-# OPTIONS -fglasgow-exts #-}
-- Various newtype-deriving failures
module ShouldFail where
class C a b
newtype T1 = T1 Int deriving( C )
-- Wrong arity
newtype T2 = T2 Int deriving( Monad )
-- Type constructor has wrong kind
newtype T3 a = T3 Int deriving( Monad )
-- Rep type has wrong kind
newtype T4 a = T4 (Either a a) deriving( Monad )
-- Eta fails
drvfail009.hs:10:
Can't make a derived instance of `C T1'
(even with cunning newtype deriving:
`C' does not have arity 1)
When deriving instances for type `T1'
drvfail009.hs:13:
Can't make a derived instance of `Monad T2'
(even with cunning newtype deriving:
the type constructor has wrong kind)
When deriving instances for type `T2'
drvfail009.hs:16:
Can't make a derived instance of `Monad T3'
(even with cunning newtype deriving:
the representation type has wrong kind)
When deriving instances for type `T3'
drvfail009.hs:19:
Can't make a derived instance of `Monad T4'
(even with cunning newtype deriving:
the eta-reduction property does not hold)
When deriving instances for type `T4'
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