[commit: ghc] ghc-8.2: testsuite: Add test for #13524 (7c896c2)
git at git.haskell.org
git at git.haskell.org
Thu Apr 13 19:56:51 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.2
Link : http://ghc.haskell.org/trac/ghc/changeset/7c896c255cb850b9e63c3f7a151ef6a72432a854/ghc
>---------------------------------------------------------------
commit 7c896c255cb850b9e63c3f7a151ef6a72432a854
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Tue Apr 4 20:47:20 2017 -0400
testsuite: Add test for #13524
Reviewers: austin
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3418
(cherry picked from commit 5b7f504f3c190375903b57a541338bc939ca2dae)
>---------------------------------------------------------------
7c896c255cb850b9e63c3f7a151ef6a72432a854
testsuite/tests/typecheck/should_compile/T13524.hs | 27 ++++++++++++++++++++++
testsuite/tests/typecheck/should_compile/all.T | 2 +-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/testsuite/tests/typecheck/should_compile/T13524.hs b/testsuite/tests/typecheck/should_compile/T13524.hs
new file mode 100644
index 0000000..0852468
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T13524.hs
@@ -0,0 +1,27 @@
+{-# LANGUAGE PartialTypeSignatures #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeApplications #-}
+
+{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-}
+
+type Empty a = ()
+
+foo :: expr a -> expr a -> expr (Empty a)
+foo = undefined
+
+newtype Expr a = SPT {run :: String}
+
+pt1 :: forall a ptexpr . ptexpr a -> ptexpr (Empty a)
+pt1 a = foo a a
+
+pt2 :: forall a ptexpr . ptexpr a -> ptexpr _
+pt2 a = foo a a
+
+main :: IO ()
+main = do
+ -- This typechecks without any trouble.
+ putStrLn $ run $ pt1 @Int @Expr undefined
+
+ -- This should also typecheck, but doesn't since GHC seems to mix up the
+ -- order of the type variables.
+ putStrLn $ run $ pt2 @Int @Expr undefined
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 09335f0..3ddda1c 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -548,4 +548,4 @@ test('T13337', normal, compile, [''])
test('T13343', normal, compile, [''])
test('T13474', normal, compile, [''])
test('T13509', normal, compile, [''])
-
+test('T13524', expect_broken(13524), compile, [''])
More information about the ghc-commits
mailing list