From 7c65687e5b14eb2f496c25198ddf761546bc4675 Mon Sep 17 00:00:00 2001 From: CarrieMY Date: Fri, 19 Nov 2021 23:33:34 +0800 Subject: Enable UnboxedTuples in `genInst`, Fixes #20524 --- testsuite/tests/deriving/should_compile/T15073.hs | 8 ++++++++ testsuite/tests/deriving/should_compile/T15073a.hs | 5 +++++ testsuite/tests/deriving/should_compile/all.T | 2 ++ testsuite/tests/deriving/should_fail/T15073.hs | 8 -------- testsuite/tests/deriving/should_fail/T15073.stderr | 9 --------- testsuite/tests/deriving/should_fail/T15073a.hs | 5 ----- testsuite/tests/deriving/should_fail/all.T | 2 -- 7 files changed, 15 insertions(+), 24 deletions(-) create mode 100644 testsuite/tests/deriving/should_compile/T15073.hs create mode 100644 testsuite/tests/deriving/should_compile/T15073a.hs delete mode 100644 testsuite/tests/deriving/should_fail/T15073.hs delete mode 100644 testsuite/tests/deriving/should_fail/T15073.stderr delete mode 100644 testsuite/tests/deriving/should_fail/T15073a.hs (limited to 'testsuite/tests/deriving') diff --git a/testsuite/tests/deriving/should_compile/T15073.hs b/testsuite/tests/deriving/should_compile/T15073.hs new file mode 100644 index 0000000000..b1da4bb701 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T15073.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE DataKinds, PolyKinds #-} +module T15073 where + +import T15073a + +newtype Foo a = MkFoo a + deriving P diff --git a/testsuite/tests/deriving/should_compile/T15073a.hs b/testsuite/tests/deriving/should_compile/T15073a.hs new file mode 100644 index 0000000000..87e7571f50 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T15073a.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE UnboxedTuples #-} +module T15073a where + +class P a where + p :: a -> (# a #) diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index e2680a8f9d..64925923ba 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -113,6 +113,8 @@ test('T14682', normal, compile, ['-ddump-deriv -dsuppress-uniques']) test('T14883', normal, compile, ['']) test('T14932', normal, compile, ['']) test('T14933', normal, compile, ['']) +test('T15073', [extra_files(['T15073a.hs'])], multimod_compile, + ['T15073', '-v0']) test('T15290c', normal, compile, ['']) test('T15290d', normal, compile, ['']) test('T15398', normal, compile, ['']) diff --git a/testsuite/tests/deriving/should_fail/T15073.hs b/testsuite/tests/deriving/should_fail/T15073.hs deleted file mode 100644 index b1da4bb701..0000000000 --- a/testsuite/tests/deriving/should_fail/T15073.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE DataKinds, PolyKinds #-} -module T15073 where - -import T15073a - -newtype Foo a = MkFoo a - deriving P diff --git a/testsuite/tests/deriving/should_fail/T15073.stderr b/testsuite/tests/deriving/should_fail/T15073.stderr deleted file mode 100644 index 79d3a10cdc..0000000000 --- a/testsuite/tests/deriving/should_fail/T15073.stderr +++ /dev/null @@ -1,9 +0,0 @@ - -T15073.hs:8:12: error: - • Illegal unboxed tuple type as function argument: (# Foo a #) - • In the type signature: p :: Foo a -> (# Foo a #) - When typechecking the code for ‘p’ - in a derived instance for ‘P (Foo a)’: - To see the code I am typechecking, use -ddump-deriv - In the instance declaration for ‘P (Foo a)’ - Suggested fix: Perhaps you intended to use UnboxedTuples \ No newline at end of file diff --git a/testsuite/tests/deriving/should_fail/T15073a.hs b/testsuite/tests/deriving/should_fail/T15073a.hs deleted file mode 100644 index 87e7571f50..0000000000 --- a/testsuite/tests/deriving/should_fail/T15073a.hs +++ /dev/null @@ -1,5 +0,0 @@ -{-# LANGUAGE UnboxedTuples #-} -module T15073a where - -class P a where - p :: a -> (# a #) diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index 4743d3530d..70bd0f9dbe 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -72,8 +72,6 @@ test('T14365', [extra_files(['T14365B.hs','T14365B.hs-boot'])], test('T14728a', normal, compile_fail, ['']) test('T14728b', normal, compile_fail, ['']) test('T14916', normal, compile_fail, ['']) -test('T15073', [extra_files(['T15073a.hs'])], multimod_compile_fail, - ['T15073', '-v0']) test('T16181', normal, compile_fail, ['']) test('T16923', normal, compile_fail, ['']) test('T18127b', normal, compile_fail, ['']) -- cgit v1.2.1