From 33fa8d9433d82b03f3209698bf27420a32302321 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Wed, 19 Feb 2020 17:06:59 -0500 Subject: 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. --- testsuite/tests/quotes/T17857.hs | 10 ++++++++++ testsuite/tests/quotes/all.T | 1 + 2 files changed, 11 insertions(+) create mode 100644 testsuite/tests/quotes/T17857.hs (limited to 'testsuite/tests/quotes') 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, ['']) -- cgit v1.2.1