[commit: ghc] master: Fix #13214 by correctly setting up dep_orphs for signatures. (26eaa7e)
git at git.haskell.org
git at git.haskell.org
Sun Feb 12 01:08:48 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/26eaa7ecde288b9dc123f3c120e70b2cf18b4e4a/ghc
>---------------------------------------------------------------
commit 26eaa7ecde288b9dc123f3c120e70b2cf18b4e4a
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date: Sat Feb 11 19:20:36 2017 -0500
Fix #13214 by correctly setting up dep_orphs for signatures.
Prior to this, I hadn't thought about orphan handling at all.
This commit implements the semantics that if a signature
(transitively) imports an orphan instance, that instance
is considered in scope no matter what the implementing module
is. (As it turns out, this is the semantics that falls out
when orphans are recorded transitively.)
This patch fixes a few bugs:
1. Put semantic modules in dep_orphs rather than identity
modules.
2. Don't put the implementing module in dep_orphs when
merging signatures (this is a silly bug that happened
because we were reusing calculateAvails, which is
designed for imports. It mostly works for signature
merging, except this case.)
3. When renaming a signature, blast in the orphans of the
implementing module inside Dependencies.
Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
Test Plan: validate
Reviewers: bgamari, austin
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3095
>---------------------------------------------------------------
26eaa7ecde288b9dc123f3c120e70b2cf18b4e4a
compiler/backpack/RnModIface.hs | 24 ++++++++++++++-
compiler/rename/RnNames.hs | 9 +++---
compiler/typecheck/TcBackpack.hs | 6 +++-
docs/users_guide/separate_compilation.rst | 5 ++++
testsuite/tests/backpack/should_compile/T13214.bkp | 33 ++++++++++++++++++++
.../tests/backpack/should_compile/T13214.stderr | 18 +++++++++++
testsuite/tests/backpack/should_compile/all.T | 2 ++
testsuite/tests/backpack/should_compile/bkp51.bkp | 35 ++++++++++++++++++++++
.../tests/backpack/should_compile/bkp51.stderr | 22 ++++++++++++++
testsuite/tests/backpack/should_fail/all.T | 1 +
testsuite/tests/backpack/should_fail/bkpfail43.bkp | 13 ++++++++
.../tests/backpack/should_fail/bkpfail43.stderr | 19 ++++++++++++
12 files changed, 181 insertions(+), 6 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 26eaa7ecde288b9dc123f3c120e70b2cf18b4e4a
More information about the ghc-commits
mailing list