summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/EtaExpansion.hs
blob: 0558adac0b247d89883409934b9238e80454a06c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Foo( wombat ) where

-- We expect to eta-expand f to arity 2, but not to arity 3
-- See Note [Bottoming bindings] in GHC.Core.Opt.Simplify
f :: String -> Int -> Int -> Int
{-# NOINLINE f #-}
f s = error s

g :: (Int -> Int -> Int) -> Maybe Int
{-# NOINLINE g #-}
g h = let h1 = h 2 in Just (h1 2 + h1 3)

wombat s = g (f s)