Hi!
The following Scala 3 code (in Scastie) fails to compile:
inline def foo(i: Int) = i + 1
Some(10).map(foo)
The error message is “missing arguments for method foo”, which suggests that the compiler interprets the foo
on the second line as an attempt to call foo
without arguments, rather than eta-expanding it (like it would if foo
wasn’t inlined).
Is this something that might get fixed in the future, or is there some fundamental technical reason that prevents inlining and automatic eta expansion from playing together nicely?
Thank you!