Avoid find_tycon panic if datacon is not in scope
authorAdam Gundry <adam@well-typed.com>
Sat, 18 Jun 2016 10:27:47 +0000 (12:27 +0200)
committerBen Gamari <ben@smart-cactus.org>
Mon, 25 Jul 2016 15:06:06 +0000 (17:06 +0200)
commit694e0f3a0803072687fab6e3a5792627f5761bd2
treef32f73ea7b8f5c9bc28a0373494301c5f153866d
parent8736625f143d55616e76ff660d476ce4a9cdb2d9
Avoid find_tycon panic if datacon is not in scope

When using TH to splice expressions involving record field construction,
the parent datacon may not be in scope.  We shouldn't panic about this,
because we will be renaming Exact RdrNames which don't require any
disambiguation.

Test Plan: new test th/T12130

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #12130

(cherry picked from commit 4d71cc89b4e9648f3fbb29c8fcd25d725616e265)
compiler/rename/RnPat.hs
testsuite/tests/th/T12130.hs [new file with mode: 0644]
testsuite/tests/th/T12130a.hs [new file with mode: 0644]
testsuite/tests/th/all.T