diff options
author | Adam Gundry <adam@well-typed.com> | 2016-06-18 12:27:47 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-06-19 00:27:06 +0200 |
commit | 4d71cc89b4e9648f3fbb29c8fcd25d725616e265 (patch) | |
tree | 8f49d476bdc4dd4085676e7e12744c7bdb72b74a /testsuite/tests/th/T12130a.hs | |
parent | 9649fc0ae45e006c2ed54cc5ea2414158949fadb (diff) | |
download | haskell-4d71cc89b4e9648f3fbb29c8fcd25d725616e265.tar.gz |
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
Diffstat (limited to 'testsuite/tests/th/T12130a.hs')
-rw-r--r-- | testsuite/tests/th/T12130a.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/th/T12130a.hs b/testsuite/tests/th/T12130a.hs new file mode 100644 index 0000000000..f393967e84 --- /dev/null +++ b/testsuite/tests/th/T12130a.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T12130a where + +import Language.Haskell.TH + +data Block = Block + { blockSelector :: () + } + +block :: Q Exp +block = + [| Block { + -- Using record syntax is neccesary to trigger the bug. + blockSelector = () + } + |] |