benleggiero
08/06/2017, 10:33 PMopen class Queue<Element>(protected var backingList: MutableList<Element> = mutableListOf()) {
fun listValue():List<Element> = List(*(backingList.toTypedArray().copyOf()))
}
Error:
Error:(44, 56) Kotlin: Cannot use 'Element' as reified type parameter. Use a class instead.
elizarov
08/07/2017, 1:03 AMbenleggiero
08/07/2017, 1:43 AMreified
is only applicable to local generic types for inline functions, and I don't see any way to make that happenelizarov
08/07/2017, 5:05 AMbackingList.toList()
would do what you are trying to do.benleggiero
08/07/2017, 9:41 PM