[commit: ghc] master: Improve exhaustive checking for guards in pattern bindings and MultiIf. (e8e9f6a)
git at git.haskell.org
git at git.haskell.org
Fri Mar 2 21:07:41 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a/ghc
>---------------------------------------------------------------
commit e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a
Author: HE, Tao <sighingnow at gmail.com>
Date: Fri Mar 2 14:16:24 2018 -0500
Improve exhaustive checking for guards in pattern bindings and MultiIf.
Previously we didn't do exhaustive checking on MultiIf expressions
and guards in pattern bindings.
We can construct the `LMatch` directly from GRHSs or [LHsExpr]
(MultiIf's alts) then feed it to checkMatches, without construct the
MatchGroup and using function `matchWrapper`.
Signed-off-by: HE, Tao <sighingnow at gmail.com>
Test Plan: make test TEST="T14773a T14773b"
Reviewers: bgamari, RyanGlScott, simonpj
Reviewed By: bgamari, simonpj
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14773
Differential Revision: https://phabricator.haskell.org/D4400
>---------------------------------------------------------------
e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a
compiler/deSugar/Check.hs | 24 +++++++++++++++---
compiler/deSugar/DsBinds.hs | 2 ++
compiler/deSugar/DsExpr.hs | 3 +++
compiler/deSugar/DsGRHSs.hs | 3 +--
compiler/hsSyn/HsExpr.hs | 29 ++++++++++++++--------
docs/users_guide/8.6.1-notes.rst | 16 ++++++++++++
testsuite/tests/deSugar/should_compile/T14773a.hs | 10 ++++++++
.../tests/deSugar/should_compile/T14773a.stderr | 5 ++++
testsuite/tests/deSugar/should_compile/T14773b.hs | 8 ++++++
.../tests/deSugar/should_compile/T14773b.stderr | 5 ++++
testsuite/tests/deSugar/should_compile/all.T | 2 ++
11 files changed, 91 insertions(+), 16 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 e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a
More information about the ghc-commits
mailing list