diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-04-04 20:47:20 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-04 20:47:21 -0400 |
commit | 5b7f504f3c190375903b57a541338bc939ca2dae (patch) | |
tree | 67b8c03207ac5dfa3de2a9288b33896feb33d7a5 | |
parent | 932b469687e17b7694f930314267899a10935cbe (diff) | |
download | haskell-5b7f504f3c190375903b57a541338bc939ca2dae.tar.gz |
testsuite: Add test for #13524
Reviewers: austin
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3418
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T13524.hs | 27 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T13524.hs b/testsuite/tests/typecheck/should_compile/T13524.hs new file mode 100644 index 0000000000..0852468233 --- /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 c6674c9b60..2436a71b63 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, ['']) |