diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-07 22:57:09 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-08 15:03:17 -0800 |
commit | 62332f36b62431ddb9ab3c97365288c7d3fc2d39 (patch) | |
tree | d4c33ac3312724a224b50206d4de5daad50e297b /testsuite | |
parent | c5fbbac9fdf86a94b636849e4aa6f1c4ecc9acf2 (diff) | |
download | haskell-62332f36b62431ddb9ab3c97365288c7d3fc2d39.tar.gz |
Setup tcg_imports earlier during signature matching, so orphans are visible.
Summary:
Previously, we updated tcg_imports after doing all of the
actual matching, which was fine for outputting the interface,
but not good enough for checking if all type classes were
implemented; we weren't treating orphans as visible (when
they needed to be.)
Fixes #12945.
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/D2802
GHC Trac Issues: #12945
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/backpack/should_compile/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_compile/bkp41.bkp | 18 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_compile/bkp41.stderr | 13 |
3 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/should_compile/all.T b/testsuite/tests/backpack/should_compile/all.T index 81bcb9aa4b..1f0136f4fc 100644 --- a/testsuite/tests/backpack/should_compile/all.T +++ b/testsuite/tests/backpack/should_compile/all.T @@ -32,3 +32,4 @@ test('bkp37', normal, backpack_compile, ['']) test('bkp38', normal, backpack_compile, ['']) test('bkp39', normal, backpack_compile, ['']) test('bkp40', normal, backpack_compile, ['']) +test('bkp41', normal, backpack_compile, ['']) diff --git a/testsuite/tests/backpack/should_compile/bkp41.bkp b/testsuite/tests/backpack/should_compile/bkp41.bkp new file mode 100644 index 0000000000..e8b5b24e35 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp41.bkp @@ -0,0 +1,18 @@ +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" + +unit sig where + signature B where + data T = T + instance Show T + module App where + import B + app = print T + +unit main where + dependency sig[B=impl:B] diff --git a/testsuite/tests/backpack/should_compile/bkp41.stderr b/testsuite/tests/backpack/should_compile/bkp41.stderr new file mode 100644 index 0000000000..0dfe754666 --- /dev/null +++ b/testsuite/tests/backpack/should_compile/bkp41.stderr @@ -0,0 +1,13 @@ +[1 of 3] Processing impl + Instantiating impl + [1 of 2] Compiling A ( impl/A.hs, bkp41.out/impl/A.o ) + [2 of 2] Compiling B ( impl/B.hs, bkp41.out/impl/B.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:B] + Instantiating sig[B=impl:B] + [1 of 2] Compiling B[sig] ( sig/B.hsig, bkp41.out/sig/sig-HVnmSw44WZeBfwnUur4wzl/B.o ) + [2 of 2] Compiling App ( sig/App.hs, bkp41.out/sig/sig-HVnmSw44WZeBfwnUur4wzl/App.o ) |