Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7cba841547654db28510a18e2d1381c37f4470dd

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

commit 7cba841547654db28510a18e2d1381c37f4470dd
Author: Simon Peyton Jones <[email protected]>
Date:   Fri Mar 2 17:49:30 2012 +0000

    Test Trac #5717

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

 tests/polykinds/T5717.hs |   20 ++++++++++++++++++++
 tests/polykinds/all.T    |    2 +-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/tests/polykinds/T5717.hs b/tests/polykinds/T5717.hs
new file mode 100644
index 0000000..5dd7ac4
--- /dev/null
+++ b/tests/polykinds/T5717.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE ScopedTypeVariables        #-}
+{-# LANGUAGE PolyKinds                  #-}
+
+module T5717 where
+
+
+data TypeRep = TypeRep
+
+data Proxy t = Proxy
+
+typeRep :: Proxy a -> TypeRep
+typeRep Proxy = TypeRep
+
+-- This one works fine:
+typeOf :: forall a. a -> TypeRep
+typeOf _ = typeRep (Proxy :: Proxy a)
+
+-- But this one panics!
+typeOf1 :: forall t a. t a -> TypeRep
+typeOf1 _ = typeRep (Proxy :: Proxy t)
diff --git a/tests/polykinds/all.T b/tests/polykinds/all.T
index a5bdebe..bf863dd 100644
--- a/tests/polykinds/all.T
+++ b/tests/polykinds/all.T
@@ -20,8 +20,8 @@ test('PolyKinds12', normal, compile, [''])
 test('T5798', normal, compile, [''])
 test('T5770', normal, compile, [''])
 test('T5771', normal, compile, [''])
+test('T5717', normal, compile, [''])
 
 test('Freeman', normal, compile_and_run, [''])
 test('MonoidsTF', normal, compile_and_run, [''])
 test('MonoidsFD', normal, compile_and_run, [''])
-



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to