summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs
diff options
context:
space:
mode:
authorCale Gibbard <cgibbard@gmail.com>2020-10-07 02:31:36 -0400
committercgibbard <cgibbard@gmail.com>2020-12-31 13:05:42 -0500
commit9b563330203e209f5e0b687108f08ddf0d2f3177 (patch)
tree4e09fc2b8f4148daac8238bfb40d9352e2e29413 /testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs
parent2113a1d600e579bb0f54a0526a03626f105c0365 (diff)
downloadhaskell-9b563330203e209f5e0b687108f08ddf0d2f3177.tar.gz
INLINE pragma for patterns (#12178)
Allow INLINE and NOINLINE pragmas to be used for patterns. Those are applied to both the builder and matcher (where applicable).
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs b/testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs
new file mode 100644
index 0000000000..1f343ab1d7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/InlinePatSyn_InlineMatcher.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE PatternSynonyms #-}
+
+module InlinePatSyn_InlineMatcher where
+
+-- Pattern with "INLINE" pragma, both builder and matcher should be inlined
+pattern InlinePattern a = [[[[a]]]]
+{-# INLINE InlinePattern #-}
+
+testInMatcher (InlinePattern x) = 1
+testInMatcher _ = 2