I’m not a chef in low-level language kitchen so i’d like to clarify it for myself. Please tell me where i’m wrong. (I’m not arguing, Just curious)
If we have that source code:
class Robin {
val superman = Superman()
fun letsRescueTheWorld() {
superman.prepare { thing -> "<Super $thing />" }
}
}
class Superman {
inline fun prepare(putOn: (String) -> String): List<String> {
return (underwear() + "Red cape with 'S'").map { putOn(it) }
}
private fun underwear(): List<String> {
return listOf("Something", "that Superman would prefer", "not to show")
}
}
Could the generated code be something like that ?:
class Robin {
val superman = Superman()
fun letsRescueTheWorld() {
// inline transformation
(superman.synthetic_underwear() + "Red cape with 'S'").map { thing -> "<Super $thing />" }
}
}
class Superman {
inline fun prepare(putOn: (String) -> String): List<String> {
return (underwear() + "Red cape with 'S'").map { putOn(it) }
}
fun synthetic_underwear() = underwear()
private fun underwear(): List<String> {
return listOf("Something", "that Superman would prefer", "not to show")
}
}
Than what is that “anything exposed by inline function that can break client code” ?
And if this assumption is in fact silly. let’s back to solutions suggested by you.
In particular by annotation do you mean something like Android @hide ?
And you did not mention are there any plans to implement any solution for that issue?