Commit 519c0d7f authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski
Browse files

Test #8428

parent e8efda20
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ImpredicativeTypes #-}
module T8428 where
import Control.Monad.ST
data IdentityT m a = IdentityT { runIdentityT :: m a }
runIdST :: IdentityT (forall s. ST s) a -> a
runIdST = runST . runIdentityT
-- Test formatting in the error message.
-- In fact this should be rejected as a kind error (#8388)
T8428.hs:11:19:
Couldn't match type ‛(forall s. ST s) a’ with ‛forall s. ST s a’
Expected type: IdentityT (forall s. ST s) a -> forall s. ST s a
Actual type: IdentityT (forall s. ST s) a -> (forall s. ST s) a
Relevant bindings include
runIdST :: IdentityT (forall s. ST s) a -> a
(bound at T8428.hs:11:1)
In the second argument of ‛(.)’, namely ‛runIdentityT’
In the expression: runST . runIdentityT
......@@ -321,4 +321,4 @@ test('TcCoercibleFailSafe', when(compiler_lt('ghc', '7.7'), skip), compile_fail,
test('TcCoercibleFail2', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''])
test('T8306', normal, compile_fail, [''])
test('T8392a', normal, compile_fail, [''])
test('T8428', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment