Fix #14838 by marking TH-spliced code as FromSource
authorRyan Scott <ryan.gl.scott@gmail.com>
Fri, 2 Mar 2018 21:16:17 +0000 (16:16 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 2 Mar 2018 21:53:40 +0000 (16:53 -0500)
commitffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383
treea43cb2b490dbaa14ed4ebc0211490050cbd4cc4e
parent68357020b1cf29d4306e769b3366feb9a65ae78c
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
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsUtils.hs
compiler/parser/RdrHsSyn.hs
compiler/typecheck/TcGenDeriv.hs
testsuite/tests/th/T14838.hs [new file with mode: 0644]
testsuite/tests/th/T14838.stderr [new file with mode: 0644]
testsuite/tests/th/T14838Lib.hs [new file with mode: 0644]
testsuite/tests/th/all.T