summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_fail/all.T
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2022-02-21 16:43:27 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-22 16:00:14 -0500
commit0b36801f8eec9b9a7cc512135a13eaf89da370a2 (patch)
tree8d6cf545d9838c1b23fa0b30f5272b0e4937eb3e /testsuite/tests/deriving/should_fail/all.T
parent2b890c89ba5de9bbf91388d7268919d5c7769bbf (diff)
downloadhaskell-0b36801f8eec9b9a7cc512135a13eaf89da370a2.tar.gz
Forbid standalone instances for built-in classes
`check_special_inst_head` includes logic that disallows hand-written instances for built-in classes such as Typeable, KnownNat and KnownSymbol. However, it also allowed standalone deriving declarations. This was because we do want to allow standalone deriving instances with Typeable as they are harmless, but we certainly don't want to allow instances for e.g. KnownNat. This patch ensures that we don't allow derived instances for KnownNat, KnownSymbol (and also KnownChar, which was previously omitted entirely). Fixes #21087
Diffstat (limited to 'testsuite/tests/deriving/should_fail/all.T')
-rw-r--r--testsuite/tests/deriving/should_fail/all.T2
1 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T
index 70bd0f9dbe..61d74b72b4 100644
--- a/testsuite/tests/deriving/should_fail/all.T
+++ b/testsuite/tests/deriving/should_fail/all.T
@@ -80,3 +80,5 @@ test('deriving-via-fail2', normal, compile_fail, [''])
test('deriving-via-fail3', normal, compile_fail, [''])
test('deriving-via-fail4', normal, compile_fail, [''])
test('deriving-via-fail5', normal, compile_fail, [''])
+test('T21087', normal, compile_fail, [''])
+test('T21087b', [extra_files(['T21087b_aux.hs','T21087b_aux.hs-boot'])], multimod_compile_fail, ['T21087b', ''])