java icon indicating copy to clipboard operation
java copied to clipboard

Kotlin immutable list causes exception

Open elifarley opened this issue 7 years ago • 2 comments

If I try to read an Any as a Kotlin data class that contains an immutable list, I get an error on ReflectionCollectionDecoder.decode_ line 44: col.clear()

Example data class that causes the error: data class Example(val problem: listOf<Int>())

See #55

elifarley avatar Mar 05 '18 06:03 elifarley

I have no experience of kotlin. Any one can help on this?

taowen avatar Mar 05 '18 06:03 taowen

listOf<Whatever>() returns an immutable implementation of empty list, which is like Java's emptyList().

Miha-x64 avatar Mar 17 '18 16:03 Miha-x64