Sorry, It seems, I have maken too short description.
I want to say that new
is not big boilerplate for me.
It is not very hard problem to make object.apply
, for me.
The real boilerplate is the lack of kotlin receiver function
I think it can be made by simple syntactic sugar in most cases. For example in the topic I have maken the example:
abstract class ExtendedFunction{
def execute():Unit
}
def doSomeThing(f:ExtendedFunction):Unit = {}
def main(args:Array[String]):Unit = {
doSomeThing{
println("ok")
}
/*it is similar to
doSomeThing{ new ExtendedFunction{
override def execute():Unit = {
println("ok")
}
}
*/
}