[commit: ghc] master: Don't replace type family instances with the same LHS in GHCi (#7102) (0abe736)
git at git.haskell.org
git at git.haskell.org
Mon Feb 6 02:25:12 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0abe7361249b0b4dc43dc66547451da8916b30bf/ghc
>---------------------------------------------------------------
commit 0abe7361249b0b4dc43dc66547451da8916b30bf
Author: Reid Barton <rwbarton at gmail.com>
Date: Sun Feb 5 20:24:06 2017 -0500
Don't replace type family instances with the same LHS in GHCi (#7102)
This fixes the easy part of #7102 by removing the logic that lets the
user replace a type family instance with a new one with the same LHS.
As discussed on that ticket, this is unsound in general. Better to have
the user redefine the type family from scratch.
The example from comment:7 involving loading modules into ghci is not
fixed yet; it actually doesn't rely on the instances having the same LHS.
This commit adds an expect_broken test for that example as well.
Test Plan: T7102a for the fix; T7102 is the test not fixed yet
Reviewers: dfeuer, austin, bgamari, goldfire
Reviewed By: dfeuer
Subscribers: dfeuer, thomie
Differential Revision: https://phabricator.haskell.org/D2994
>---------------------------------------------------------------
0abe7361249b0b4dc43dc66547451da8916b30bf
compiler/main/HscTypes.hs | 5 +--
compiler/typecheck/FamInst.hs | 21 +++++-------
compiler/types/FamInstEnv.hs | 32 ++----------------
docs/users_guide/ghci.rst | 38 +++++++++++++++++++---
testsuite/tests/ghci/scripts/ghci046.script | 1 +
testsuite/tests/ghci/scripts/ghci046.stderr | 5 +++
testsuite/tests/ghci/scripts/ghci046.stdout | 2 +-
.../tests/indexed-types/should_fail/T7102.script | 5 +++
.../should_fail/T7102.stdout} | 0
.../tests/indexed-types/should_fail/T7102A.hs | 3 ++
.../tests/indexed-types/should_fail/T7102B.hs | 6 ++++
.../tests/indexed-types/should_fail/T7102C.hs | 6 ++++
.../tests/indexed-types/should_fail/T7102a.script | 4 +++
.../tests/indexed-types/should_fail/T7102a.stderr | 5 +++
testsuite/tests/indexed-types/should_fail/all.T | 2 ++
15 files changed, 84 insertions(+), 51 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 0abe7361249b0b4dc43dc66547451da8916b30bf
More information about the ghc-commits
mailing list