diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-13 18:03:47 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-13 19:00:54 -0800 |
commit | 9c9a2229fe741c55a8fb8d0c6380ec066a77722b (patch) | |
tree | 6c11ce6e64c2a9e8e9bbfce51939e7c2abf92bf4 /testsuite/tests/backpack/should_compile | |
parent | 8ec864d08c09a8aa7aabc4abf30186e5f3995ad4 (diff) | |
download | haskell-9c9a2229fe741c55a8fb8d0c6380ec066a77722b.tar.gz |
Load orphan interfaces before checking if module implements signature
Summary:
If we didn't load the orphans, we might conclude an instance
is not implemented when it is. See test bkp42.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2841
Diffstat (limited to 'testsuite/tests/backpack/should_compile')
-rw-r--r-- | testsuite/tests/backpack/should_compile/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_compile/bkp42.bkp | 21 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_compile/bkp42.stderr | 14 |
3 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/should_compile/all.T b/testsuite/tests/backpack/should_compile/all.T index 1f0136f4fc..bb77278d26 100644 --- a/testsuite/tests/backpack/should_compile/all.T +++ b/testsuite/tests/backpack/should_compile/all.T @@ -33,3 +33,4 @@ test('bkp38', normal, backpack_compile, ['']) test('bkp39', normal, backpack_compile, ['']) test('bkp40', normal, backpack_compile, ['']) test('bkp41', normal, backpack_compile, ['']) +test('bkp42', normal, backpack_compile, ['']) diff --git a/testsuite/tests/backpack/should_compile/bkp42.bkp b/testsuite/tests/backpack/should_compile/bkp42.bkp new file mode 100644 index 0000000000..59590f9125 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp42.bkp @@ -0,0 +1,21 @@ +unit impl where + module A where + data T = T + module B(module A, module B) where + import A + instance Show T where + show T = "T" + module C(module B) where + import B + +unit sig where + signature B where + data T + instance Show T + module App where + import B + app :: T -> IO () + app t = print t + +unit main where + dependency sig[B=impl:C] diff --git a/testsuite/tests/backpack/should_compile/bkp42.stderr b/testsuite/tests/backpack/should_compile/bkp42.stderr new file mode 100644 index 0000000000..69d8d7cf14 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp42.stderr @@ -0,0 +1,14 @@ +[1 of 3] Processing impl + Instantiating impl + [1 of 3] Compiling A ( impl/A.hs, bkp42.out/impl/A.o ) + [2 of 3] Compiling B ( impl/B.hs, bkp42.out/impl/B.o ) + [3 of 3] Compiling C ( impl/C.hs, bkp42.out/impl/C.o ) +[2 of 3] Processing sig + [1 of 2] Compiling B[sig] ( sig/B.hsig, nothing ) + [2 of 2] Compiling App ( sig/App.hs, nothing ) +[3 of 3] Processing main + Instantiating main + [1 of 1] Including sig[B=impl:C] + Instantiating sig[B=impl:C] + [1 of 2] Compiling B[sig] ( sig/B.hsig, bkp42.out/sig/sig-Ko6MwJiRFc509cOdDShPV5/B.o ) + [2 of 2] Compiling App ( sig/App.hs, bkp42.out/sig/sig-Ko6MwJiRFc509cOdDShPV5/App.o ) |