summaryrefslogtreecommitdiff
path: root/testsuite/tests/roles
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2014-11-07 17:34:59 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2014-11-20 15:26:24 -0500
commite394e74df5ca8081c0ffd147d34e788d290fb21a (patch)
tree90f3625fba0f43bc0fa107ffd18c65edf068e307 /testsuite/tests/roles
parent5a8ae60ef9dc52ab04350ffbcf2945c9177eac87 (diff)
downloadhaskell-e394e74df5ca8081c0ffd147d34e788d290fb21a.tar.gz
Fix #9220 by adding role annotations.
This includes a submodule update for `array`. There is also an added test in libraries/array/tests/T9220.
Diffstat (limited to 'testsuite/tests/roles')
-rw-r--r--testsuite/tests/roles/should_compile/all.T1
-rw-r--r--testsuite/tests/roles/should_fail/RolesIArray.hs (renamed from testsuite/tests/roles/should_compile/RolesIArray.hs)0
-rw-r--r--testsuite/tests/roles/should_fail/RolesIArray.stderr100
-rw-r--r--testsuite/tests/roles/should_fail/all.T1
4 files changed, 101 insertions, 1 deletions
diff --git a/testsuite/tests/roles/should_compile/all.T b/testsuite/tests/roles/should_compile/all.T
index 744b9342a6..0bd779ff3b 100644
--- a/testsuite/tests/roles/should_compile/all.T
+++ b/testsuite/tests/roles/should_compile/all.T
@@ -4,5 +4,4 @@ test('Roles3', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles4', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles13', only_ways('normal'), compile, ['-ddump-simpl -dsuppress-uniques'])
test('Roles14', only_ways('normal'), compile, ['-ddump-tc'])
-test('RolesIArray', only_ways('normal'), compile, [''])
test('T8958', [normalise_fun(normalise_errmsg), only_ways('normal')], compile, ['-ddump-tc -dsuppress-uniques'])
diff --git a/testsuite/tests/roles/should_compile/RolesIArray.hs b/testsuite/tests/roles/should_fail/RolesIArray.hs
index a79909d827..a79909d827 100644
--- a/testsuite/tests/roles/should_compile/RolesIArray.hs
+++ b/testsuite/tests/roles/should_fail/RolesIArray.hs
diff --git a/testsuite/tests/roles/should_fail/RolesIArray.stderr b/testsuite/tests/roles/should_fail/RolesIArray.stderr
new file mode 100644
index 0000000000..aad2f2b18a
--- /dev/null
+++ b/testsuite/tests/roles/should_fail/RolesIArray.stderr
@@ -0,0 +1,100 @@
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘Data.Array.Base.unsafeAccumArray’
+ from type ‘forall e' i.
+ Ix i =>
+ (Word64 -> e' -> Word64)
+ -> Word64 -> (i, i) -> [(Int, e')] -> UArray i Word64’
+ to type ‘forall e' i.
+ Ix i =>
+ (N -> e' -> N) -> N -> (i, i) -> [(Int, e')] -> UArray i N’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘Data.Array.Base.unsafeAccum’
+ from type ‘forall e' i.
+ Ix i =>
+ (Word64 -> e' -> Word64)
+ -> UArray i Word64 -> [(Int, e')] -> UArray i Word64’
+ to type ‘forall e' i.
+ Ix i =>
+ (N -> e' -> N) -> UArray i N -> [(Int, e')] -> UArray i N’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘Data.Array.Base.unsafeReplace’
+ from type ‘forall i.
+ Ix i =>
+ UArray i Word64 -> [(Int, Word64)] -> UArray i Word64’
+ to type ‘forall i.
+ Ix i =>
+ UArray i N -> [(Int, N)] -> UArray i N’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘Data.Array.Base.unsafeAt’
+ from type ‘forall i. Ix i => UArray i Word64 -> Int -> Word64’
+ to type ‘forall i. Ix i => UArray i N -> Int -> N’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘Data.Array.Base.unsafeArray’
+ from type ‘forall i.
+ Ix i =>
+ (i, i) -> [(Int, Word64)] -> UArray i Word64’
+ to type ‘forall i. Ix i => (i, i) -> [(Int, N)] -> UArray i N’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘Data.Array.Base.numElements’
+ from type ‘forall i. Ix i => UArray i Word64 -> Int’
+ to type ‘forall i. Ix i => UArray i N -> Int’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
+
+RolesIArray.hs:10:13:
+ Could not coerce from ‘UArray i Word64’ to ‘UArray i N’
+ because the second type argument of ‘UArray’ has role Nominal,
+ but the arguments ‘Word64’ and ‘N’ differ
+ arising from the coercion of the method ‘bounds’
+ from type ‘forall i. Ix i => UArray i Word64 -> (i, i)’
+ to type ‘forall i. Ix i => UArray i N -> (i, i)’
+ Possible fix:
+ use a standalone 'deriving instance' declaration,
+ so you can specify the instance context yourself
+ When deriving the instance for (IArray UArray N)
diff --git a/testsuite/tests/roles/should_fail/all.T b/testsuite/tests/roles/should_fail/all.T
index 1c69b7c48c..94674daa26 100644
--- a/testsuite/tests/roles/should_fail/all.T
+++ b/testsuite/tests/roles/should_fail/all.T
@@ -10,3 +10,4 @@ test('Roles12',
test('T8773', normal, compile_fail, [''])
test('T9204', extra_clean(['T9204.o-boot', 'T9204.hi-boot']),
run_command, ['$MAKE --no-print-directory -s T9204'])
+test('RolesIArray', normal, compile_fail, [''])