summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-10-04 13:56:23 +0200
committerBen Gamari <ben@well-typed.com>2022-02-21 17:09:25 +0000
commit177d6a7849632fe07d2ed785aadc7d23f7d28ae9 (patch)
treeb44df7c8602c69d02a49155da7738d8a4cda7d3b
parent73342a968ff8d47bc7cb22b52f6ecd959bbae612 (diff)
downloadhaskell-177d6a7849632fe07d2ed785aadc7d23f7d28ae9.tar.gz
Add a regression test for #17723
The underlying bug was fixed by b8d98827, see MR !2477 (cherry picked from commit 48b0f17acff0c35df2d3b63dd6b624832cd54852)
-rw-r--r--testsuite/tests/typecheck/should_compile/Makefile5
-rw-r--r--testsuite/tests/typecheck/should_compile/T17723.hs7
-rw-r--r--testsuite/tests/typecheck/should_compile/T17723a.hs19
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
4 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/Makefile b/testsuite/tests/typecheck/should_compile/Makefile
index 5cb3bd2001..7bd632cfd7 100644
--- a/testsuite/tests/typecheck/should_compile/Makefile
+++ b/testsuite/tests/typecheck/should_compile/Makefile
@@ -76,6 +76,11 @@ T14934:
'$(TEST_HC)' $(TEST_HC_OPTS) -c T14934a.hs -O
'$(TEST_HC)' $(TEST_HC_OPTS) -c T14934.hs -O
+T17723:
+ $(RM) -f T17723a.o T17723a.hi T17723.o T17723.hi
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c T17723a.hs -O
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c T17723.hs -O
+
T17566:
$(RM) -f T17566a.o T17566a.hi T17566.o T17566.hi
'$(TEST_HC)' $(TEST_HC_OPTS) -c T17566a.hs
diff --git a/testsuite/tests/typecheck/should_compile/T17723.hs b/testsuite/tests/typecheck/should_compile/T17723.hs
new file mode 100644
index 0000000000..a36bcd4cb2
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T17723.hs
@@ -0,0 +1,7 @@
+
+module T17723 where
+
+import T17723a
+
+data Foo
+instance C Foo
diff --git a/testsuite/tests/typecheck/should_compile/T17723a.hs b/testsuite/tests/typecheck/should_compile/T17723a.hs
new file mode 100644
index 0000000000..e808aa77f5
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T17723a.hs
@@ -0,0 +1,19 @@
+
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE DefaultSignatures #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeInType #-}
+
+module T17723a (C(..)) where
+
+import GHC.Exts
+
+-- Essentially a stripped-down version of the `Lift` type class from
+-- Language.Haskell.TH.Syntax. I have redefined it here both to strip away
+-- inessential details and to ensure that this test case will not change if
+-- the API of Lift were to change in the future.
+class C (a :: TYPE (r :: RuntimeRep)) where
+ m :: a -> ()
+ default m :: (r ~ LiftedRep) => a -> ()
+ m = const ()
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 6addb72e6f..62861d741f 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -714,6 +714,7 @@ test('T17792', normal, compile, [''])
test('T17024', normal, compile, [''])
test('T19186', normal, compile, [''])
test('T17021a', normal, compile, [''])
+test('T17723', [], makefile_test, [])
test('T19665', expect_broken(19665), compile, [''])
test('T18005', normal, compile, [''])
test('T18023', normal, compile, [''])