diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-07-13 13:28:27 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-07-13 13:28:27 +0100 |
commit | 02a6b29cc85b2820016fb66ae426dee7ecd36895 (patch) | |
tree | 343b36d204066fa975a817267a996e701d8fdca6 /testsuite | |
parent | d7335f74744a78bb468326b13fdd8b0c471eb71f (diff) | |
download | haskell-02a6b29cc85b2820016fb66ae426dee7ecd36895.tar.gz |
Test Trac #10634
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T10634.hs | 23 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/all.T | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T10634.hs b/testsuite/tests/indexed-types/should_compile/T10634.hs new file mode 100644 index 0000000000..f02cf810da --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T10634.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE TypeFamilies #-} +module T10634 where + +import Data.Int (Int8, Int16, Int32) + +type family Up a +type instance Up Int8 = Int16 +type instance Up Int16 = Int32 + +class (Up (Down a) ~ a) => Convert a where + type Down a + down :: a -> Down a + +instance Convert Int16 where + type Down Int16 = Int8 + down = fromIntegral + +instance Convert Int32 where + type Down Int32 = Int16 + down = fromIntegral + +x :: Int8 +x = down 8 diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index 67be121788..3bc73a3963 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -260,4 +260,4 @@ test('T10139', normal, compile, ['']) test('T10340', normal, compile, ['']) test('T10226', normal, compile, ['']) test('T10507', normal, compile, ['']) - +test('T10634', normal, compile, ['']) |