I have this Java class that I want to use from Kotlin code.
class JavaDialogBuilder<B extends JavaDialogBuilder>
This java code compiles fine:
void javaTest() {
new JavaDialogBuilder();
}
Converting it to the Kotlin equivalent code does not.
fun javaTest() {
JavaDialogBuilder() // <-- compilation error here
}
The compilation error is:
Type inference failed: Not enough information to infer parameter B in
constructor JavaDialogBuilder<B : (JavaDialogBuilder<JavaDialogBuilder<*>>..JavaDialogBuilder<out JavaDialogBuilder<*>>?)>
( )
Please specify it explicitly.
Is there a way to fix this?