summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/InlinePatSyn_NoInlineBuilder.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_NoInlineBuilder.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_NoInlineBuilder.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/InlinePatSyn_NoInlineBuilder.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/InlinePatSyn_NoInlineBuilder.hs b/testsuite/tests/typecheck/should_compile/InlinePatSyn_NoInlineBuilder.hs
new file mode 100644
index 0000000000..39b265e937
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/InlinePatSyn_NoInlineBuilder.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE PatternSynonyms #-}
+
+module InlinePatSyn_NoInlineBuilder where
+
+-- Pattern with "NOINLINE" pragma, neither builder nor matcher should be inlined
+pattern NonInlinablePattern a = Left a
+{-# NOINLINE NonInlinablePattern #-}
+
+testNonBuilder x = NonInlinablePattern (x+1)