diff options
author | sheaf <sam.derbyshire@gmail.com> | 2021-10-04 13:56:23 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-04 23:47:35 -0400 |
commit | 48b0f17acff0c35df2d3b63dd6b624832cd54852 (patch) | |
tree | 32914af2b02dabefbb337135ff106d4592b93bca | |
parent | a14d0e6375d6b7163d98db8d32a2fc67434608b7 (diff) | |
download | haskell-48b0f17acff0c35df2d3b63dd6b624832cd54852.tar.gz |
Add a regression test for #17723
The underlying bug was fixed by b8d98827, see MR !2477
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 9983ff20da..f3be68a470 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('T17772', normal, compile, ['']) test('T19665', expect_broken(19665), compile, ['']) test('T18005', normal, compile, ['']) |