Fix #14719 by using the setting the right SrcSpan
authorRyan Scott <ryan.gl.scott@gmail.com>
Fri, 26 Jan 2018 18:10:26 +0000 (13:10 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 29 Jan 2018 21:20:01 +0000 (16:20 -0500)
commitc60c6590fed1a708619db02e5f572f72a26a65ad
tree5f2bee571e54d29fdd43348d3da87b0a5e59f1dd
parentd4d6e448d1700dbc074058540724fab54e5f0f33
Fix #14719 by using the setting the right SrcSpan

Currently, error messages that germane to GADT constructors
put the source span at only the first character in the constructor,
leading to insufficient caret diagnostics. This can be easily fixed
by using a source span that spans the entire constructor, instead of
just the first character.

Test Plan: make test TEST=T14719

Reviewers: alanz, bgamari, simonpj

Reviewed By: alanz, simonpj

Subscribers: simonpj, goldfire, rwbarton, thomie, carter

GHC Trac Issues: #14719

Differential Revision: https://phabricator.haskell.org/D4344

(cherry picked from commit 59fa7b32b018a91f81773ca676251a0b2761ef56)
compiler/typecheck/TcTyClsDecls.hs
testsuite/tests/gadt/T14719.hs [new file with mode: 0644]
testsuite/tests/gadt/T14719.stderr [new file with mode: 0644]
testsuite/tests/gadt/all.T
testsuite/tests/polykinds/T9222.stderr