Closed kmdupr33 closed 6 years ago
This is working as intended, unfortunately.
AutoValue adds prefixes of an increasing number of $
symbols for the more extensions that apply to a single AutoValue type. In Java, you can reference nested classes from subtypes of the type in which the class is nested. Kotlin, however, does not allow this trick, which means that you must reference the nested class by directly referring to the class in which it was generated. What's also crazy, is that if you add a third extension to your project it might actually bump the JSON generator later in the chain and it would actually cause your build to fail because they have moved to $$AutoValue_LockSelectionModel
.
wow. bummer. Thanks for clearing that up.
I have a Kotlin auto-value class that implements parcelable and needs to be serialized by moshi. I'm using auto-value-parceleable and auto-value-moshi. I've followed the recommendation in issue #70 to include a
@JvmStatic
annotation on my jsonAdapter factory method. However, theMoshiJsonAdapter
nested class is generated on$AutoValue_<class_name>
instead ofAutoValue_<class_name>
.That feels like a bug. My class looks like this: