diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2020-09-22 18:01:09 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-24 13:17:07 -0400 |
commit | 6d0ce0eb772bf69c57e14f30c16c606ab5035816 (patch) | |
tree | f8bfe7825e38e7dd2a5e1e60a619874c1c5dcc95 /testsuite/tests/pmcheck | |
parent | 9fa26aa16f9eee0b56b5d9e65c16367d7b789996 (diff) | |
download | haskell-6d0ce0eb772bf69c57e14f30c16c606ab5035816.tar.gz |
PmCheck: Desugar string literal patterns with -XRebindableSyntax correctly (#18708)
Fixes #18708.
Diffstat (limited to 'testsuite/tests/pmcheck')
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T18708.hs | 20 | ||||
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T18708.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/all.T | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T18708.hs b/testsuite/tests/pmcheck/should_compile/T18708.hs new file mode 100644 index 0000000000..8eafb69a76 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T18708.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RebindableSyntax #-} + +module A (main) where + +import Prelude +import Data.Text + + +fromString :: String -> Text +fromString = pack + +y :: Text +y = "y" + +main :: IO () +main = do + case y of + "y" -> return () + return () diff --git a/testsuite/tests/pmcheck/should_compile/T18708.stderr b/testsuite/tests/pmcheck/should_compile/T18708.stderr new file mode 100644 index 0000000000..5949d92970 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T18708.stderr @@ -0,0 +1,5 @@ + +T18708.hs:18:3: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: + Patterns not matched: p where p is not one of {"y"} diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index bd5fc60f63..862c5e134a 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -148,6 +148,8 @@ test('T18572', normal, compile, ['-fwarn-incomplete-patterns -fwarn-incomplete-uni-patterns -fwarn-overlapping-patterns']) test('T18670', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) +test('T18708', normal, compile, + ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) # Other tests test('pmc001', [], compile, |