[commit: ghc] master: Test for type synonym loops on TyCon. (31398fb)
git at git.haskell.org
git at git.haskell.org
Thu Nov 17 05:32:38 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/31398fbc6d9ee0bd95de64b08becc38faf188972/ghc
>---------------------------------------------------------------
commit 31398fbc6d9ee0bd95de64b08becc38faf188972
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date: Fri Oct 28 17:54:36 2016 -0700
Test for type synonym loops on TyCon.
Summary:
Previously, we tested for type synonym loops by doing
a syntactic test on the literal type synonym declarations.
However, in some cases, loops could go through hs-boot
files, leading to an infinite loop (#12042); a similar
situation can occur when signature merging.
This commit replaces the syntactic test with a test on
TyCon, simply by walking down all type synonyms until
we bottom out, or find we've looped back. It's a lot
simpler.
Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: goldfire, thomie
Differential Revision: https://phabricator.haskell.org/D2656
GHC Trac Issues: #12042
>---------------------------------------------------------------
31398fbc6d9ee0bd95de64b08becc38faf188972
compiler/hsSyn/HsDecls.hs | 1 +
compiler/typecheck/TcBackpack.hs | 4 +
compiler/typecheck/TcBinds.hs | 4 +-
compiler/typecheck/TcTyClsDecls.hs | 157 ++-
compiler/typecheck/TcTyDecls.hs | 209 ++--
compiler/types/Type.hs | 2 +
docs/users_guide/8.2.1-notes.rst | 10 +
docs/users_guide/glasgow_exts.rst | 4 +-
testsuite/driver/extra_files.py | 1 +
testsuite/tests/backpack/should_fail/all.T | 1 +
.../should_fail/{bkpfail04.bkp => bkpfail29.bkp} | 12 +-
.../tests/backpack/should_fail/bkpfail29.stderr | 11 +
testsuite/tests/module/mod27.stderr | 2 +-
testsuite/tests/typecheck/should_compile/all.T | 3 +
testsuite/tests/typecheck/should_compile/tc268.hs | 5 +
testsuite/tests/typecheck/should_compile/tc269.hs | 22 +
testsuite/tests/typecheck/should_compile/tc270.hs | 1006 ++++++++++++++++++++
testsuite/tests/typecheck/should_fail/T12042.hs | 4 +
.../tests/typecheck/should_fail/T12042.hs-boot | 3 +
.../tests/typecheck/should_fail/T12042.stderr | 9 +
testsuite/tests/typecheck/should_fail/T12042a.hs | 3 +
testsuite/tests/typecheck/should_fail/all.T | 1 +
22 files changed, 1321 insertions(+), 153 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 31398fbc6d9ee0bd95de64b08becc38faf188972
More information about the ghc-commits
mailing list