diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-02-19 17:06:59 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-20 21:56:21 -0500 |
commit | 33fa8d9433d82b03f3209698bf27420a32302321 (patch) | |
tree | a9a655bca0d40012fea8581173c94a6fa4e51840 /testsuite/tests/quotes | |
parent | 581753790da8d094ce05b3fc5f5360f5fbf6a7da (diff) | |
download | haskell-33fa8d9433d82b03f3209698bf27420a32302321.tar.gz |
Generalize liftData to work over any Quote (#17857)
The Overloaded Quotations proposal generalized the type of `lift`
to work over any `Quote`, but not the type of `liftData`, leading
to #17857. Thankfully, generalizing `liftData` is extremely
straightforward.
Fixes #17857.
Diffstat (limited to 'testsuite/tests/quotes')
-rw-r--r-- | testsuite/tests/quotes/T17857.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/quotes/all.T | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/quotes/T17857.hs b/testsuite/tests/quotes/T17857.hs new file mode 100644 index 0000000000..f64f0ce753 --- /dev/null +++ b/testsuite/tests/quotes/T17857.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE DeriveDataTypeable #-} +module T17857 where + +import Data.Data +import Language.Haskell.TH.Syntax + +data T = MkT deriving Data +instance Lift T where + lift = liftData + liftTyped = unsafeTExpCoerce . lift diff --git a/testsuite/tests/quotes/all.T b/testsuite/tests/quotes/all.T index 46f53bce6a..1a5d5242b4 100644 --- a/testsuite/tests/quotes/all.T +++ b/testsuite/tests/quotes/all.T @@ -16,6 +16,7 @@ test('T8759a', normal, compile, ['-v0']) test('T9824', normal, compile, ['-v0']) test('T10384', normal, compile_fail, ['']) test('T16384', req_th, compile, ['']) +test('T17857', normal, compile, ['']) test('TH_tf2', normal, compile, ['-v0']) test('TH_ppr1', normal, compile_and_run, ['']) |