summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Arr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/Arr.hs')
-rw-r--r--libraries/base/GHC/Arr.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/base/GHC/Arr.hs b/libraries/base/GHC/Arr.hs
index e68c70f6bc..cefef97f0f 100644
--- a/libraries/base/GHC/Arr.hs
+++ b/libraries/base/GHC/Arr.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE Unsafe #-}
-{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-}
+{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, RoleAnnotations #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
@@ -385,6 +385,10 @@ data STArray s i e
-- No Ix context for STArray. They are stupid,
-- and force an Ix context on the equality instance.
+-- Index types should have nominal role, because of Ix class. See also #9220.
+type role Array nominal representational
+type role STArray nominal nominal representational
+
-- Just pointer equality on mutable arrays:
instance Eq (STArray s i e) where
STArray _ _ _ arr1# == STArray _ _ _ arr2# =