Commit 53e07d8b authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #5147

parent 085a89b8
module A where
import B
showField :: Fields v -> String
showField a = show a
{-# LANGUAGE TypeFamilies #-}
module B where
class Entity v where
data Fields v
instance Show (Fields v) where show = undefined
{-# LANGUAGE TypeFamilies #-}
module B where
class Entity v where
data Fields v
-- Remove instance
-- instance Show (Fields v) where show = undefined
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# Recompilation tests
clean:
rm -f *.o *.hi
rm -f B.hs C
# Removing an instance declaration should force recompilation
# failed in GHC 7.0
T5147: clean
cp B1.hs B.hs
'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 A.hs
sleep 1
cp B2.hs B.hs
if '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 A.hs; then exit 1; else exit 0; fi
# Reverse the sense of the error; we *expect*
# the compilation to fail, and then we want to succeed
A.hs:6:15:
No instance for (Show (Fields v))
arising from a use of `show'
Possible fix: add an instance declaration for (Show (Fields v))
In the expression: show a
In an equation for `showField': showField a = show a
test('T5147',
[clean_cmd('$MAKE -s clean')],
run_command,
['$MAKE -s --no-print-directory T5147'])
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