summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-03 10:38:28 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-06 19:22:58 -0400
commit0415449a6ef67ed8d6413683a3edabb23ff6ebe3 (patch)
tree94e27ec85fd3f807e515926ef8813c77cb329cc8 /testsuite/tests
parente2ae9518c0373db7a99058a09388043a66af80ad (diff)
downloadhaskell-0415449a6ef67ed8d6413683a3edabb23ff6ebe3.tar.gz
template-haskell: Fix representation of OPAQUE pragmas
There is a mis-match between the TH representation of OPAQUE pragmas and GHC's internal representation due to how OPAQUE pragmas disallow phase annotations. It seemed most in keeping to just fix the wired in name issue by adding a special case to the desugaring of INLINE pragmas rather than making TH/GHC agree with how the representation should look. Fixes #21463
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/th/T21463.hs10
-rw-r--r--testsuite/tests/th/all.T1
2 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/th/T21463.hs b/testsuite/tests/th/T21463.hs
new file mode 100644
index 0000000000..bec226f72d
--- /dev/null
+++ b/testsuite/tests/th/T21463.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TemplateHaskell #-}
+module Main where
+
+main :: IO ()
+main = print
+ $([| let f :: Int -> Int
+ f x = x + 1
+ {-# OPAQUE f #-}
+ in f 41
+ |])
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 2a003b8141..ec79e19249 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -538,6 +538,7 @@ test('T20060', normal, compile, [''])
test('T20179', normal, compile_fail, [''])
test('T17820a', normal, compile_fail, [''])
test('T17820b', normal, compile_fail, [''])
+test('T21463', normal, compile, [''])
test('T17820c', normal, compile_fail, [''])
test('T17820d', normal, compile_fail, [''])
test('T17820e', normal, compile_fail, [''])