summaryrefslogtreecommitdiff
path: root/testsuite/tests/linear/should_fail/LinearViewPattern.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/linear/should_fail/LinearViewPattern.hs')
-rw-r--r--testsuite/tests/linear/should_fail/LinearViewPattern.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/linear/should_fail/LinearViewPattern.hs b/testsuite/tests/linear/should_fail/LinearViewPattern.hs
new file mode 100644
index 0000000000..737393911b
--- /dev/null
+++ b/testsuite/tests/linear/should_fail/LinearViewPattern.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE LinearTypes #-}
+{-# LANGUAGE ViewPatterns #-}
+
+module LinearViewPattern where
+
+-- This is probably inessential. We are just protecting against potential
+-- incorrect Core being emitted by the desugarer. When we understand linear view
+-- pattern better, we will probably want to remove this test.
+
+f :: Bool #-> Bool
+f (not -> True) = True