Add regression test for #12850
authorRyan Scott <ryan.gl.scott@gmail.com>
Thu, 11 May 2017 13:33:43 +0000 (09:33 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Thu, 11 May 2017 13:34:27 +0000 (09:34 -0400)
Commit e7985ed23ddc68b6a2e4af753578dc1d9e8ab4c9 happened to fix #12850, so
let's add a regression test for the program reported in #12850.

testsuite/tests/typecheck/should_compile/T12850.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

diff --git a/testsuite/tests/typecheck/should_compile/T12850.hs b/testsuite/tests/typecheck/should_compile/T12850.hs
new file mode 100644 (file)
index 0000000..660b4c5
--- /dev/null
@@ -0,0 +1,10 @@
+{-# LANGUAGE ExplicitForAll, MagicHash, KindSignatures #-}
+module T12850 where
+
+import GHC.Types (RuntimeRep(..), TYPE)
+
+f :: forall (x :: TYPE 'IntRep). x -> x
+f x = x
+
+g = ()
+    where h = f 0#
index 6db86a8..2f34144 100644 (file)
@@ -530,6 +530,7 @@ test('T12734a', normal, compile_fail, [''])
 test('T12763', normal, compile, [''])
 test('T12785a', normal, compile, [''])
 test('T12797', normal, compile, [''])
+test('T12850', normal, compile, [''])
 test('T12911', normal, compile, [''])
 test('T12925', normal, compile, [''])
 test('T12919', expect_broken(12919), compile, [''])