Commit e0eaa7f1 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

Types families: test that the right coercion names go into ifaces

parent aa0e74ed
TOP=../../../.. TOP=../../../..
include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk include $(TOP)/mk/test.mk
NewTyCo:
$(TEST_HC) -c NewTyCo1.hs
$(TEST_HC) -c NewTyCo2.hs
{-# OPTIONS -ftype-families #-}
module NewTyCo1 where
data family T a
newtype instance T Int = TInt Int
foo :: T Int -> Int
foo (TInt n) = n
{-# OPTIONS -ftype-families #-}
module NewTyCo2 where
import NewTyCo1
bar x = foo x + 1
...@@ -21,3 +21,9 @@ clean(['ATLoop_Help.o','ATLoop_Help.hi']) ...@@ -21,3 +21,9 @@ clean(['ATLoop_Help.o','ATLoop_Help.hi'])
test('Deriving', normal, compile, ['']) test('Deriving', normal, compile, [''])
test('DerivingNewType', expect_fail, compile, ['']) test('DerivingNewType', expect_fail, compile, [''])
test('Records', normal, compile, ['']) test('Records', normal, compile, [''])
# The point about this test is that it compiles NewTyCo1 and NewTyCo2
# *separately*
#
test('NewTyCo', ignore_output, run_command, ['$MAKE NewTyCo'])
clean(['NewTyCo1.o', 'NewTyCo1.hi', 'NewTyCo2.o', 'NewTyCo2.hi'])
Supports Markdown
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