Skip to content

Kotlin immutable list causes exception #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
elifarley opened this issue Mar 5, 2018 · 2 comments
Open

Kotlin immutable list causes exception #168

elifarley opened this issue Mar 5, 2018 · 2 comments

Comments

@elifarley
Copy link
Contributor

elifarley commented Mar 5, 2018

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

@taowen
Copy link
Contributor

taowen commented Mar 5, 2018

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

taowen added a commit that referenced this issue Mar 5, 2018
Possible fix for #168 - Always create new instance of col
elifarley added a commit to elifarley/java that referenced this issue Mar 5, 2018
taowen added a commit that referenced this issue Mar 6, 2018
Revert "Possible fix for #168 - Always create new instance of col"
@Miha-x64
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants