-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Compiler version
3.2, bcaa1ca
Minimized code
inline def foo(f: Int => Int): Int => Int = f
inline def bar(inline f: Int => Int): Int => Int = f
def g(i: Int): Int = i
def test =
foo(f = g)
bar(f = g)
Output
-Xprint:inlining
package <empty> {
final lazy module val Test_2$package: Test_2$package = new Test_2$package()
@SourceFile("t/Test_2.scala") final module class Test_2$package() extends
Object() { this: Test_2$package.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[Test_2$package.type])
def g(i: Int): Int = i
def test: Int => Int =
{
{
val f$proxy1: Int => Int =
f =
{
def $anonfun(i: Int): Int = g(i)
closure($anonfun)
}
f$proxy1:(Int => Int)
}
f =
{
def $anonfun(i: Int): Int = g(i)
closure($anonfun)
}
:(Int => Int)
}
}
}
Expectation
We should not inline the f =
from the named argument (NamedArg
).