summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T5689.hs
blob: 10628b5641dca47d50e6bc2942fcf65c45345e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE ScopedTypeVariables #-}

module Main where
import Data.IORef

main :: IO ()
main = do { (r :: IORef (t -> t)) <- newIORef id
             -- r <- newIORef i -- => Type-check error

          ; writeIORef r (\v -> if v then False else True)

          ; c <- readIORef r

          ; print $ c True
          ; print $ c 1234 }