diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-01-05 01:09:29 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-01-11 06:53:58 -0800 |
commit | e41c61fa7792d12ac7ffbacda7a5b3ba6ef2a267 (patch) | |
tree | 8ba7dec03f3b34ef08e77e7bd3ed6fa012136a8d /testsuite/tests/backpack/should_compile | |
parent | 0bbcf76a349ed2c1d03907f2f74e5436859d59b0 (diff) | |
download | haskell-e41c61fa7792d12ac7ffbacda7a5b3ba6ef2a267.tar.gz |
Improve Backpack support for fixities.
Summary:
Two major bug-fixes:
- Check that fixities match between hsig and implementation
- Merge and preserve fixities when merging signatures
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: bgamari, simonpj, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2919
GHC Trac Issues: #13066
Diffstat (limited to 'testsuite/tests/backpack/should_compile')
4 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/should_compile/all.T b/testsuite/tests/backpack/should_compile/all.T index 299b28a7bc..f38e364a61 100644 --- a/testsuite/tests/backpack/should_compile/all.T +++ b/testsuite/tests/backpack/should_compile/all.T @@ -36,3 +36,4 @@ test('bkp41', normal, backpack_compile, ['']) test('bkp42', normal, backpack_compile, ['']) test('bkp43', normal, backpack_compile, ['']) test('bkp44', normal, backpack_compile, ['']) +test('bkp45', normal, backpack_compile, ['']) diff --git a/testsuite/tests/backpack/should_compile/bkp39.bkp b/testsuite/tests/backpack/should_compile/bkp39.bkp index 45f680e94f..bf98b10c96 100644 --- a/testsuite/tests/backpack/should_compile/bkp39.bkp +++ b/testsuite/tests/backpack/should_compile/bkp39.bkp @@ -4,6 +4,7 @@ unit p where import Prelude hiding ((==)) class K a class K2 a + infix 4 == (==) :: K a => a -> a -> Bool module M where import Prelude hiding ((==)) diff --git a/testsuite/tests/backpack/should_compile/bkp45.bkp b/testsuite/tests/backpack/should_compile/bkp45.bkp new file mode 100644 index 0000000000..56f640413d --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp45.bkp @@ -0,0 +1,17 @@ +unit p where + signature A where + infixl 7 `mul` + mul :: Int -> Bool -> Char +unit q where + signature A where + infixl 7 `mul` + mul :: Int -> Bool -> Char +unit r where + dependency p[A=<A>] + dependency q[A=<A>] + module B where + import A + infixl 6 `plu` + plu :: () -> Char -> String + plu = undefined + x = () `plu` 3 `mul` True diff --git a/testsuite/tests/backpack/should_compile/bkp45.stderr b/testsuite/tests/backpack/should_compile/bkp45.stderr new file mode 100644 index 0000000000..4a6f1d68aa --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp45.stderr @@ -0,0 +1,7 @@ +[1 of 3] Processing p + [1 of 1] Compiling A[sig] ( p/A.hsig, nothing ) +[2 of 3] Processing q + [1 of 1] Compiling A[sig] ( q/A.hsig, nothing ) +[3 of 3] Processing r + [1 of 2] Compiling A[sig] ( r/A.hsig, nothing ) + [2 of 2] Compiling B ( r/B.hs, nothing ) |