diff options
author | Cale Gibbard <cgibbard@gmail.com> | 2020-10-07 02:31:36 -0400 |
---|---|---|
committer | cgibbard <cgibbard@gmail.com> | 2020-12-31 13:05:42 -0500 |
commit | 9b563330203e209f5e0b687108f08ddf0d2f3177 (patch) | |
tree | 4e09fc2b8f4148daac8238bfb40d9352e2e29413 /testsuite/tests/typecheck/should_compile/InlinePatSyn_ExplicitBidiMatcher.hs | |
parent | 2113a1d600e579bb0f54a0526a03626f105c0365 (diff) | |
download | haskell-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_ExplicitBidiMatcher.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/InlinePatSyn_ExplicitBidiMatcher.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/InlinePatSyn_ExplicitBidiMatcher.hs b/testsuite/tests/typecheck/should_compile/InlinePatSyn_ExplicitBidiMatcher.hs new file mode 100644 index 0000000000..9c45a2f0ad --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/InlinePatSyn_ExplicitBidiMatcher.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE PatternSynonyms #-} + +module InlinePatSyn_ExplicitBidiMatcher where + +-- Explicit bidirectional pattern +pattern ExplicitPattern x <- x:xs where + ExplicitPattern x = [x] +{-# INLINE ExplicitPattern #-} + +testMatcherofExplicitBuilder (ExplicitPattern x) = 1 +testMatcherofExplicitBuilder _ = 2 |