Youssef Shoaib [MOD]
06/18/2022, 5:32 PM@NullDefaults
with null
for a default argument and the function replaces that argument with the default value. Check the repo for more examples
E.g:
// Kotlin
fun test(value: Int = 42) {
println(value)
}
// Java
public static void main(String[] args){
TestKt.test(null); // Prints 42
}
Try it today:
plugins {
...
id("io.github.kyay10.kotlin-null-defaults") version "0.2.0"
}