summaryrefslogtreecommitdiff
path: root/testsuite/tests/linear/should_fail/Linear11.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/linear/should_fail/Linear11.hs')
-rw-r--r--testsuite/tests/linear/should_fail/Linear11.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/linear/should_fail/Linear11.hs b/testsuite/tests/linear/should_fail/Linear11.hs
new file mode 100644
index 0000000000..67b930ac57
--- /dev/null
+++ b/testsuite/tests/linear/should_fail/Linear11.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE LinearTypes #-}
+{-# LANGUAGE UnicodeSyntax #-}
+module Linear11 where
+
+data Unrestricted a where Unrestricted :: a -> Unrestricted a
+
+incorrectUnrestricted :: a ⊸ Unrestricted a
+incorrectUnrestricted a = Unrestricted a
+
+data NotUnrestricted a where NotUnrestricted :: a ⊸ NotUnrestricted a
+
+incorrectUnrestrictedDup :: NotUnrestricted a ⊸ (a,a)
+incorrectUnrestrictedDup (NotUnrestricted a) = (a,a)