yeah, I've removed it, it says construction is not...
# announcements
j
yeah, I've removed it, it says construction is not yet supported in inline functions
i
j
Awesome stuff! That would obviously allow me to get rid of the
noinline
hacks. Would that also allow me to this?
Copy code
inline fun blah(
    f1: (em: EM) -> Unit = { },
    f2: (em: EM) -> Any? = { null } 
): Result {
    f1(em)
    val res = f2(em)
    return Result()
}
Copy code
blah {
   // no statement here
}
and
Copy code
blah {
   "a string statement" // statement which can be picked up by `val res = f2(em)`
}
i
In both cases the lambda is passed as the
f2
argument.
j
Currently scenario 1 doesn't compile, should it?
Copy code
blah {
   // no statement here
}
Expected a value of Any?
Even when I reduce it to:
Copy code
val ffun: (em: EntityManager) -> Any? = { null }
Copy code
inline fun blah(
    noinline f: (em: EM) -> Any? = ffun
): Result {
    val res = f(em)
    return Result()
}
i
I think it should. If it's not, please report a bug.
j
cool, will do so