https://kotlinlang.org logo
Title
a

Andreas Sinz

06/10/2018, 8:41 AM
@zucen.co the
justFunction
will be compiled into two different methods. Thats not really possible with lambdas or local functions, because you have only one
val singleParamFun
z

zucen.co

06/10/2018, 8:46 AM
aah as I am still very new to this "so much generated code during compile" i did not realize named args functions are implemented as every used variant into real method... but i understand it has to work on jvm..
k

karelpeeters

06/10/2018, 8:48 AM
It won't be compiled to two functions though? See eg. https://stackoverflow.com/questions/46024775/why-kotlin-function-with-default-parameters-creates-a-method-with-unused-paramet for an overview of the decompiled bytecode.
a

Andreas Sinz

06/10/2018, 8:51 AM
z

zucen.co

06/10/2018, 10:23 AM
Interesting now I at least kow how this works under the hood 🙂 thanks