summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorShayne Fletcher <shayne.fletcher@digitalasset.com>2018-12-11 13:49:48 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-11 18:19:46 -0500
commit8a4edd15d87849d070f7608b0825789a22e52374 (patch)
treec4578c6971be5ddbb29c380dd1fefd663a44a5e4 /testsuite
parentc98e25a4de88f12c6ded0a97fcf3ed8f4996b9ea (diff)
downloadhaskell-8a4edd15d87849d070f7608b0825789a22e52374.tar.gz
Enable rebindable fail with overloaded strings
Summary: enable rebindable fail with overloaded strings Reviewers: bgamari, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, ndmitchell, rwbarton, carter GHC Trac Issues: #15645 Differential Revision: https://phabricator.haskell.org/D5251
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_compile/T15645.hs17
-rw-r--r--testsuite/tests/typecheck/should_compile/T15645.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
3 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T15645.hs b/testsuite/tests/typecheck/should_compile/T15645.hs
new file mode 100644
index 0000000000..d558b510d7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T15645.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE RebindableSyntax, OverloadedStrings #-}
+
+module T15645 where
+
+import Prelude hiding (fail)
+
+foo x = do
+ Just y <- x
+ return y
+
+newtype Text = Text String
+
+fail :: Text -> a
+fail (Text x) = error x
+
+fromString :: String -> Text
+fromString = Text
diff --git a/testsuite/tests/typecheck/should_compile/T15645.stderr b/testsuite/tests/typecheck/should_compile/T15645.stderr
new file mode 100644
index 0000000000..566d6bf18e
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T15645.stderr
@@ -0,0 +1,4 @@
+T15645.hs:8:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)]
+ The failable pattern ‘Just y’
+ is used together with -XRebindableSyntax. If this is intentional,
+ compile with -Wno-missing-monadfail-instances.
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index bebdc6cef5..a8e8cfe910 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -653,6 +653,7 @@ test('T15473', normal, compile_fail, [''])
test('T15499', normal, compile, [''])
test('T15586', normal, compile, [''])
test('T15368', normal, compile, ['-fdefer-type-errors'])
+test('T15645', normal, compile, ['-Wwarn=missing-monadfail-instances'])
test('T15778', normal, compile, [''])
test('T14761c', normal, compile, [''])
test('T16008', normal, compile, [''])