summaryrefslogtreecommitdiff
path: root/testsuite/tests/backpack/should_fail
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-02-28 23:55:00 -0800
committerEdward Z. Yang <ezyang@cs.stanford.edu>2017-03-02 15:59:02 -0800
commitdf919fb21c951c1892bd96d9e6306ce1bec3daa9 (patch)
tree39dd2ffdc9d61f1de04a114481832876f68d4adf /testsuite/tests/backpack/should_fail
parentfb5cd9d6d6185afe6d4ef2f3df3f895b6d0abf4c (diff)
downloadhaskell-df919fb21c951c1892bd96d9e6306ce1bec3daa9.tar.gz
Fix roles merging to apply only to non-rep-injective types.
Test Plan: validate Reviewers: simonpj Subscribers:
Diffstat (limited to 'testsuite/tests/backpack/should_fail')
-rw-r--r--testsuite/tests/backpack/should_fail/all.T1
-rw-r--r--testsuite/tests/backpack/should_fail/bkpfail47.bkp12
-rw-r--r--testsuite/tests/backpack/should_fail/bkpfail47.stderr21
3 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/should_fail/all.T b/testsuite/tests/backpack/should_fail/all.T
index 82b4e6803b..e1416fcec8 100644
--- a/testsuite/tests/backpack/should_fail/all.T
+++ b/testsuite/tests/backpack/should_fail/all.T
@@ -42,3 +42,4 @@ test('bkpfail43', normal, backpack_compile_fail, [''])
test('bkpfail44', normal, backpack_compile_fail, [''])
test('bkpfail45', normal, backpack_compile_fail, [''])
test('bkpfail46', normal, backpack_compile_fail, [''])
+test('bkpfail47', normal, backpack_compile_fail, [''])
diff --git a/testsuite/tests/backpack/should_fail/bkpfail47.bkp b/testsuite/tests/backpack/should_fail/bkpfail47.bkp
new file mode 100644
index 0000000000..b8d4ae66d8
--- /dev/null
+++ b/testsuite/tests/backpack/should_fail/bkpfail47.bkp
@@ -0,0 +1,12 @@
+{-# LANGUAGE RoleAnnotations #-}
+unit p where
+ signature A where
+ type role T nominal representational
+ data T a b
+unit q where
+ signature A where
+ type role T representational nominal
+ data T a b = MkT
+unit r where
+ dependency p[A=<A>]
+ dependency q[A=<A>]
diff --git a/testsuite/tests/backpack/should_fail/bkpfail47.stderr b/testsuite/tests/backpack/should_fail/bkpfail47.stderr
new file mode 100644
index 0000000000..b2bc08b4c2
--- /dev/null
+++ b/testsuite/tests/backpack/should_fail/bkpfail47.stderr
@@ -0,0 +1,21 @@
+[1 of 3] Processing p
+ [1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
+[2 of 3] Processing q
+ [1 of 1] Compiling A[sig] ( q/A.hsig, nothing )
+[3 of 3] Processing r
+ [1 of 1] Compiling A[sig] ( r/A.hsig, nothing )
+
+bkpfail47.bkp:9:9: error:
+ • Type constructor ‘T’ has conflicting definitions in the module
+ and its hsig file
+ Main module: type role T representational nominal
+ data T a b = MkT
+ Hsig file: type role T nominal representational
+ data T a b
+ The roles are not compatible:
+ Main module: [representational, nominal]
+ Hsig file: [nominal, representational]
+ • while merging the signatures from:
+ • p[A=<A>]:A
+ • q[A=<A>]:A
+ • ...and the local signature for A