Kotlingenericstypes,types推断失败

Kotlin参考文件说这个例子是有效的。

https://kotlinlang.org/docs/reference/generics.html#upper-bounds

fun  cloneWhenGreater(list: List, threshold: T): List where T : Comparable, T : Cloneable { return list.filter { it > threshold }.map { it.clone() } } 

但在Android studio 3.0中,它显示在它下面的细红线it.clone()it.clone() 。 而错误信息是:

types推断失败。 期望的types不匹配。
必需: List
find: List

为什么这个例子不能被编译?

问题是使用clone() ,它在编译器抱怨时protected 。 这个问题已经在这里讨论过了: https : //discuss.kotlinlang.org/t/is-the-documentation-correct/2925