Test Trac #8537
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 22 Nov 2013 15:29:05 +0000 (15:29 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 22 Nov 2013 15:50:53 +0000 (15:50 +0000)
testsuite/tests/simplCore/should_compile/T8537.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T8537.stderr [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T

diff --git a/testsuite/tests/simplCore/should_compile/T8537.hs b/testsuite/tests/simplCore/should_compile/T8537.hs
new file mode 100644 (file)
index 0000000..f3f8864
--- /dev/null
@@ -0,0 +1,20 @@
+{-# LANGUAGE GADTs, DataKinds, KindSignatures, FlexibleInstances #-}
+
+module T8537 where
+
+import Data.Functor
+
+data Nat = S !Nat  | Z
+
+infixr 3 :*
+
+data Shape (rank :: Nat) a where
+    Nil  :: Shape Z a
+    (:*) ::  !(a) -> !(Shape r a ) -> Shape  (S r) a
+
+instance Functor (Shape Z) where
+
+    fmap  = \ f Nil -> Nil
+    {-# INLINABLE fmap #-}
+
+    {-# SPECIALIZE fmap :: (Int ->Int )-> (Shape Z Int)-> (Shape Z Int) #-}
diff --git a/testsuite/tests/simplCore/should_compile/T8537.stderr b/testsuite/tests/simplCore/should_compile/T8537.stderr
new file mode 100644 (file)
index 0000000..f27ee67
--- /dev/null
@@ -0,0 +1,3 @@
+
+T8537.hs:20:5: Warning:
+    SPECIALISE pragma for non-overloaded function ‛fmap’
index fa31898..ecc88e1 100644 (file)
@@ -197,3 +197,4 @@ test('T5996',
      normal,
      run_command,
      ['$MAKE -s --no-print-directory T5996'])
+test('T8537', normal, compile, [''])