[commit: testsuite] master: Test Trac #8537 (2a88f8f)

git at git.haskell.org git at git.haskell.org
Fri Nov 22 15:51:05 UTC 2013


Repository : ssh://git@git.haskell.org/testsuite

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2a88f8fbe24f3a9e832f3bc76ac3b877e79cf978/testsuite

>---------------------------------------------------------------

commit 2a88f8fbe24f3a9e832f3bc76ac3b877e79cf978
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Nov 22 15:29:05 2013 +0000

    Test Trac #8537


>---------------------------------------------------------------

2a88f8fbe24f3a9e832f3bc76ac3b877e79cf978
 tests/simplCore/should_compile/T8537.hs     |   20 ++++++++++++++++++++
 tests/simplCore/should_compile/T8537.stderr |    3 +++
 tests/simplCore/should_compile/all.T        |    1 +
 3 files changed, 24 insertions(+)

diff --git a/tests/simplCore/should_compile/T8537.hs b/tests/simplCore/should_compile/T8537.hs
new file mode 100644
index 0000000..f3f8864
--- /dev/null
+++ b/tests/simplCore/should_compile/T8537.hs
@@ -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/tests/simplCore/should_compile/T8537.stderr b/tests/simplCore/should_compile/T8537.stderr
new file mode 100644
index 0000000..f27ee67
--- /dev/null
+++ b/tests/simplCore/should_compile/T8537.stderr
@@ -0,0 +1,3 @@
+
+T8537.hs:20:5: Warning:
+    SPECIALISE pragma for non-overloaded function ‛fmap’
diff --git a/tests/simplCore/should_compile/all.T b/tests/simplCore/should_compile/all.T
index fa31898..ecc88e1 100644
--- a/tests/simplCore/should_compile/all.T
+++ b/tests/simplCore/should_compile/all.T
@@ -197,3 +197,4 @@ test('T5996',
      normal,
      run_command,
      ['$MAKE -s --no-print-directory T5996'])
+test('T8537', normal, compile, [''])



More information about the ghc-commits mailing list