Ticket #7748: GHCLoop.hs

File GHCLoop.hs, 533 bytes (added by jbransen, 14 months ago)
Line 
1-- Correct type, which is inferred by GHC 7.6.1 and
2-- works fine with GHC 7.6.2:
3-- test :: Maybe (Maybe (r -> ())) -> r -> ()
4
5-- Incorrect type, resulting in a runtime <<loop>>,
6-- inferred by GHC 7.6.2 and also accepted by GHC 7.6.1:
7-- test :: a -> r -> ()
8test zd
9 = let f = let g = case zd of
10                       Nothing       -> const ()
11                       Just Nothing  -> const ()
12                       Just (Just p) -> p
13           in  g
14   in f
15
16main :: IO ()
17main = do
18  let x = test (Just Nothing) ()
19  print x