The following code should compile.
class Foo{
fun <T: Runnable >start(callback: ( T) -> Unit = {}){
}
fun test(){
start() //doesn't compile
}
}
Compiler Error:
Type inference failed: Not enough information to infer parameter T in
fun start> (> callback: (T) → Unit = …> ) : Unit
Please specify it explicitly.
Kotlin 1.2.21