diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2013-11-22 15:29:05 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2013-11-22 15:50:53 +0000 |
commit | b99d8aa9122472929dcff48a5d45c84bb778f53b (patch) | |
tree | 274b4c1267b87376156f04145b4576c19c0fd234 | |
parent | e38b994e6922f5b8b9f5f2186f77452dde59008a (diff) | |
download | haskell-b99d8aa9122472929dcff48a5d45c84bb778f53b.tar.gz |
Test Trac #8537
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T8537.hs | 20 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T8537.stderr | 3 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/all.T | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T8537.hs b/testsuite/tests/simplCore/should_compile/T8537.hs new file mode 100644 index 0000000000..f3f8864d65 --- /dev/null +++ b/testsuite/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/testsuite/tests/simplCore/should_compile/T8537.stderr b/testsuite/tests/simplCore/should_compile/T8537.stderr new file mode 100644 index 0000000000..f27ee675a5 --- /dev/null +++ b/testsuite/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/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index fa3189865d..ecc88e176e 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/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, ['']) |