summaryrefslogtreecommitdiff
path: root/compiler/backpack
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2016-10-14 00:11:10 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2016-10-20 12:45:40 -0700
commit9df4ce4f89b6d999822ae30ff777bdaf26665c06 (patch)
tree03016e5127a1f3d8f74a2fe19c1aceaf7148cc4e /compiler/backpack
parent7e77c4b2ee08d7f88df8ba47537640ec1bd70bfe (diff)
downloadhaskell-9df4ce4f89b6d999822ae30ff777bdaf26665c06.tar.gz
Only delete instances when merging when there is an exact match.
Summary: Previously, we deleted if the heads matched, which meant that we effectively were picking an arbitrary instance if there were incompatible instances. The new behavior makes more sense, although without incoherent instances you are unlikely to be able to do anything useful with the instances. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2596
Diffstat (limited to 'compiler/backpack')
-rw-r--r--compiler/backpack/RnModIface.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/backpack/RnModIface.hs b/compiler/backpack/RnModIface.hs
index 0bf7c9678f..e70254243f 100644
--- a/compiler/backpack/RnModIface.hs
+++ b/compiler/backpack/RnModIface.hs
@@ -319,8 +319,9 @@ rnIfaceClsInst cls_inst = do
-- really matter, since we throw it out shortly after
-- (for merging, we rename all of the DFuns so that they
-- are unique; for instantiation, the final interface never
- -- mentions DFuns since they are implicitly exported.) The
- -- important thing is that it's consistent everywhere.
+ -- mentions DFuns since they are implicitly exported. See
+ -- Note [Signature merging DFuns]) The important thing is that it's
+ -- consistent everywhere.
dfun <- rnIfaceDFun (ifDFun cls_inst)
return cls_inst { ifInstCls = n
, ifInstTys = tys