[commit: ghc] master: Add a test for Trac #13951 (2f45341)

git at git.haskell.org git at git.haskell.org
Tue Mar 12 00:29:08 UTC 2019


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

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

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

commit 2f453414c5b1b27b6a84a3b5c7cd1bb5449f1f5d
Author: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io>
Date:   Thu Mar 7 19:08:59 2019 +0100

    Add a test for Trac #13951
    
    It no longer gives a warning.


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

2f453414c5b1b27b6a84a3b5c7cd1bb5449f1f5d
 testsuite/tests/typecheck/should_compile/T13951.hs | 19 +++++++++++++++++++
 testsuite/tests/typecheck/should_compile/all.T     |  1 +
 2 files changed, 20 insertions(+)

diff --git a/testsuite/tests/typecheck/should_compile/T13951.hs b/testsuite/tests/typecheck/should_compile/T13951.hs
new file mode 100644
index 0000000..8cbeb8c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T13951.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE PolyKinds, GADTs, Rank2Types, ScopedTypeVariables, Trustworthy #-}
+module Control.Monad.Skeleton.Internal where
+
+data Cat k a b where
+  Empty :: Cat k a a
+  Leaf :: k a b -> Cat k a b
+  Tree :: Cat k a b -> Cat k b c -> Cat k a c
+
+viewL :: forall k a b r. Cat k a b
+  -> ((a ~ b) => r)
+  -> (forall x. k a x -> Cat k x b -> r)
+  -> r
+viewL Empty e _ = e
+viewL (Leaf k) _ r = k `r` Empty
+viewL (Tree a b) e r = go a b where
+  go :: Cat k a x -> Cat k x b -> r
+  go Empty t = viewL t e r
+  go (Leaf k) t = r k t
+  go (Tree c d) t = go c (Tree d t)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index d312f50..b94f021 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -669,3 +669,4 @@ test('T16188', normal, compile, [''])
 test('T16204a', normal, compile, [''])
 test('T16204b', normal, compile, [''])
 test('T16225', normal, compile, [''])
+test('T13951', normal, compile, [''])



More information about the ghc-commits mailing list