summaryrefslogtreecommitdiff
path: root/testsuite/tests/linear/should_fail/LinearRole.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/linear/should_fail/LinearRole.hs')
-rw-r--r--testsuite/tests/linear/should_fail/LinearRole.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/linear/should_fail/LinearRole.hs b/testsuite/tests/linear/should_fail/LinearRole.hs
new file mode 100644
index 0000000000..403935f4ce
--- /dev/null
+++ b/testsuite/tests/linear/should_fail/LinearRole.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE LinearTypes, GADTs, DataKinds #-}
+
+module LinearRole where -- #18799
+
+import GHC.Types (Multiplicity(..))
+import Data.Coerce
+
+data T m a where
+ MkT :: a %m -> T m a
+
+f :: T 'One a -> T 'Many a
+f x = coerce x