class Testing {
private void testIt() {
Builder b = new Builder();
b.directory = java.io.File("/som/path"); // <<<<< shows error
b.directory = io.matthewnelson.kmp.file.File.get("/some/path"); // <<<< IDE error
}
}
This is because commonMain the File.kt file is annotated with JvmName("File") such that in Java land, directory is expecting io.matthewnelson.kmp.file.File and not the typealias
Removing the JvmName annotation would allow for the following from Java and present no errors.
class Testing {
private void testIt() {
Builder b = new Builder();
b.directory = FileKt.get("/some/path");
}
}
This is because
commonMain
theFile.kt
file is annotated withJvmName("File")
such that in Java land,directory
is expectingio.matthewnelson.kmp.file.File
and not the typealiasRemoving the
JvmName
annotation would allow for the following from Java and present no errors.