summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
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, [''])