[commit: ghc] master: testsuite: Add test for #13524 (5b7f504)
git at git.haskell.org
git at git.haskell.org
Wed Apr 5 00:49:42 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/5b7f504f3c190375903b57a541338bc939ca2dae/ghc
>---------------------------------------------------------------
commit 5b7f504f3c190375903b57a541338bc939ca2dae
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
>---------------------------------------------------------------
5b7f504f3c190375903b57a541338bc939ca2dae
testsuite/tests/typecheck/should_compile/T13524.hs | 27 ++++++++++++++++++++++
testsuite/tests/typecheck/should_compile/all.T | 1 +
2 files changed, 28 insertions(+)
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 c6674c9..2436a71 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -551,3 +551,4 @@ test('T13343', normal, compile, [''])
test('T13458', normal, compile, [''])
test('T13490', normal, compile, [''])
test('T13474', normal, compile, [''])
+test('T13524', expect_broken(13524), compile, [''])
More information about the ghc-commits
mailing list