# Is the documentation correct?

**URL:** <https://discuss.kotlinlang.org/t/is-the-documentation-correct/2925>\
**Category:** Uncategorized\
**Created:** [May 27, 2017, 5:46am UTC](https://discuss.kotlinlang.org/t/is-the-documentation-correct/2925 "2017-05-27T05:46:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dalewking](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/dalewking/32/1496_2.png) [@dalewking](https://discuss.kotlinlang.org/u/dalewking)\
**Post date:** [October 22, 2017, 2:53am UTC](https://discuss.kotlinlang.org/t/is-the-documentation-correct/2925/2 "2017-10-22T02:53:07Z")

</div>

Definitely seems to be an error.

There are 2 problems with that code that you found:

- The need to specify type parameter on Comparable (note you do not need to add the “in”)
- Java’s clone is protected

The code was revised in the current version to make the result List which adds another error:

- If you were to be able to clone you would then need to cast to T which is not a problem in your example since you have List

I think the point of the example was about multiple where clauses not about cloning, but the code in the reference should be correct.

The cloneable issue was discussed here, but did not solve the problem:

> [@How to use Cloneable?](https://discuss.kotlinlang.org/t/how-to-use-cloneable/2364):
>
> I must be doing something stupid frowning but open class TempA : Cloneable { val s = "123" val i = 123 val d = 1.23 } class TempB : TempA() { val c = 'c' } Then in any func val tempb = TempB() val tempb2 = tempb.clone() as TempB ‘Cannot access clone: it is protected in TempB’ inline error appears in IDE.

Apparentlhy clone is not supported in Kotlin?

---

_[View the full topic](https://discuss.kotlinlang.org/t/is-the-documentation-correct/2925)._
