on a nested data class. Why this restriction is present?
🤔 2
😮 1
s
steelahhh
08/06/2020, 3:10 PM
I don't think there was such a restriction. Maybe if you could post the code sample with this case?
e
electrolobzik
08/06/2020, 4:40 PM
You are right. I was also surprised. But after a couple of experiments I am able to add Parcelize to the nested class. Sometimes it works, sometimes not. Looks like a bug in the kotlin plugin. For example I am taking a class, doing Cmd+A, Cmd+C + Cmd+V and it works on a copy, but doesn’t work in the source file. The same module, package, the same folder. I am confused and still trying to get stable example.
electrolobzik
08/06/2020, 4:53 PM
Ahah, reproduced finally:
electrolobzik
08/06/2020, 4:53 PM
Copy code
package com.test_parcelize
import com.test_parcelize.TestNestedParcelize.*
interface TestI<T : Any>
class TestNestedParcelize : TestI<State> {
@Parcelize
data class State(
val isLoading: Boolean = false
)
}
electrolobzik
08/06/2020, 4:54 PM
if I replace
TestNestedParcelize.*
to
TestNestedParcelize.State
everything works.
electrolobzik
08/06/2020, 4:54 PM
In the example above the kotlin plugin doesn’t work correctly