[commit: ghc] master: Fix #14838 by marking TH-spliced code as FromSource (ffb2738)

git at git.haskell.org git at git.haskell.org
Fri Mar 2 21:54:26 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383/ghc

>---------------------------------------------------------------

commit ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Fri Mar 2 16:16:17 2018 -0500

    Fix #14838 by marking TH-spliced code as FromSource
    
    Previously, any Template Haskell code that was spliced would
    be marked as `Generated`, which would completely suppress pattern-
    match coverage warnings for it, which several folks found confusing.
    Indeed, Template Haskell-spliced code is "source" code in some sense,
    as users specifically request that it be put into their program, so
    changing its designation to `FromSource` makes sense from that
    perspective.
    
    Test Plan: make test TEST=T14838
    
    Reviewers: goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #14838
    
    Differential Revision: https://phabricator.haskell.org/D4440


>---------------------------------------------------------------

ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383
 compiler/hsSyn/Convert.hs        |  4 ++--
 compiler/hsSyn/HsUtils.hs        | 14 +++++++-------
 compiler/parser/RdrHsSyn.hs      | 10 +++++-----
 compiler/typecheck/TcGenDeriv.hs |  8 +++++---
 testsuite/tests/th/T14838.hs     | 14 ++++++++++++++
 testsuite/tests/th/T14838.stderr | 18 ++++++++++++++++++
 testsuite/tests/th/T14838Lib.hs  | 14 ++++++++++++++
 testsuite/tests/th/all.T         |  2 ++
 8 files changed, 67 insertions(+), 17 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 ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383


More information about the ghc-commits mailing list