summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail165.hs
blob: 11c016b08b9ffcdd64a946120c8c89a7d9abb16b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# OPTIONS -XImpredicativeTypes -fno-warn-deprecated-flags #-}

module ShouldFail where

import Control.Concurrent

-- Attempt to put a polymorphic value in an MVar
-- Fails, but the error message is worth keeping an eye on
--
-- Actually (Dec 06) it succeeds now
--
-- In GHC 7.0 it fails again! (and rightly so)
--
-- With the Visible Type Application patch, this succeeds again.
--
-- Sept 16: fails again as it should

foo = do var <- newEmptyMVar :: IO (MVar (forall a. Show a => a -> String))
         putMVar var (show :: forall b. Show b => b -> String)