summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T4444.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T4444.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T4444.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T4444.hs b/testsuite/tests/typecheck/should_compile/T4444.hs
new file mode 100644
index 0000000000..5f07d5d71d
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T4444.hs
@@ -0,0 +1,18 @@
+
+-- #4444: We shouldn't warn about SPECIALISE INLINE pragmas on
+-- non-overloaded functions
+
+{-# LANGUAGE GADTs, MagicHash #-}
+module Q where
+
+import GHC.Exts
+
+data Arr e where
+ ArrInt :: !Int -> ByteArray# -> Arr Int
+ ArrPair :: !Int -> Arr e1 -> Arr e2 -> Arr (e1, e2)
+
+(!:) :: Arr e -> Int -> e
+{-# SPECIALISE INLINE (!:) :: Arr Int -> Int -> Int #-}
+{-# SPECIALISE INLINE (!:) :: Arr (a, b) -> Int -> (a, b) #-}
+(ArrInt _ ba) !: (I# i) = I# (indexIntArray# ba i)
+(ArrPair _ a1 a2) !: i = (a1 !: i, a2 !: i)