summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/EtaExpansion.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal/should_compile/EtaExpansion.hs')
-rw-r--r--testsuite/tests/stranal/should_compile/EtaExpansion.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/EtaExpansion.hs b/testsuite/tests/stranal/should_compile/EtaExpansion.hs
new file mode 100644
index 0000000000..0558adac0b
--- /dev/null
+++ b/testsuite/tests/stranal/should_compile/EtaExpansion.hs
@@ -0,0 +1,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)