Commit 4c2e9dc1 authored by simonpj's avatar simonpj
Browse files

[project @ 2002-11-11 10:46:31 by simonpj]

Add a new deriving test
parent 8453eeb2
......@@ -15,3 +15,4 @@ test('drvrun009', normal, compile_and_run, [''])
test('drvrun010', normal, compile_and_run, [''])
test('drvrun011', normal, compile_and_run, [''])
test('drvrun012', normal, compile_and_run, [''])
test('drvrun013', normal, compile_and_run, [''])
-- This test makes sure that the derivied instance for
-- Eq A
-- "sees" the non-derived instance for
-- Eq B
--
-- In a version of GHC 5.05, this didn't happen, because the
-- deriving mechanism looked through A's rep-type and found Int
module Main where
newtype B = MkB Int
instance Eq B where
(MkB 1) == (MkB 2) = True -- Non-standard equality
(MkB a) == (MkB b) = False
newtype A = MkA B deriving( Eq )
main = print (MkA (MkB 1) == MkA (MkB 2))
-- Should say "True", because of B's non-standard instance
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