I have a Java Class function as below
public void setPositiveButton(int resId, DialogInterface.OnClickListener listener)
I also have the same Kotlin Class function as below
fun setPositiveButton(resId: Int, listener: DialogInterface.OnClickListener)
When I call them from a Kotlin code
javaClassObj.setPositiveButton(R.string.some_string,
DialogInterface.OnClickListener { _, _ -> someFunc()})
kotlinClassObj.setPositiveButton(R.string.some_string,
DialogInterface.OnClickListener { _, _ -> someFunc()})
The Java Class function call could be reduced, but not the Kotlin Class function
javaClassObj.setPositiveButton(R.string.some_string,
{ _, _ -> someFunc()})
kotlinClassObj.setPositiveButton(R.string.some_string,
DialogInterface.OnClickListener { _, _ -> someFunc()})
Why can't the Kotlin function call reduce the redundant SAM-Constructor as per enabled for Java?