Why joinToString and joinTo are not inline?


Currently all implementations of joinToString and joinTo are not inline and produces classes when used with callback.
Are any reasons for not make this functions inline?


They produce a lot of bytecode when being inlined.


Why this is problem?


To some extent it’s a problem, especially for methods with many optional parameters, see these issues: https://youtrack.jetbrains.com/issue/KT-12497 and https://youtrack.jetbrains.com/issue/KT-10848.


I think see your point: inlining these functions may broke code because of bugs in Kotlin inlining.
Understood, thank you.


These are performance problems, not bugs. They result in more bytecode than necessary being inlined, however it doesn’t break the code.