You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it gets converted to Kotlin it spits the following error: error: @JsonField annotation can only be used on private fields if both getter and setter are present.. I would love to give an exact line for where it's happening, but there's a bug in Kotlin 1.0.6 where kapt doesn't show this. The bug has been fixed for future versions, but god knows when 1.0.7 is gonna be here. This is the Kotlin file used: (I kept nullability so it's as close as possible to the Java version)
The only difference between Java List and Kotlin List types is a presence of wildcard: List<X> in Kotlin compiles to wildcard type List<? extends X> because type parameter in Kotlin's List has out variance.
Correct workaround is List<@JvmSuppressWildcards X>, but you can also use MutableList<X> or ArrayList<X>.
Same true for Sets/Collections/Iterables, Maps, Pairs and so on.
I've got the following Java file that works fine in LoganSquare:
When it gets converted to Kotlin it spits the following error:
error: @JsonField annotation can only be used on private fields if both getter and setter are present.
. I would love to give an exact line for where it's happening, but there's a bug in Kotlin 1.0.6 where kapt doesn't show this. The bug has been fixed for future versions, but god knows when 1.0.7 is gonna be here. This is the Kotlin file used: (I kept nullability so it's as close as possible to the Java version)And it's decompiled to the following Java:
HolidayPeriod
andOpeningPeriod
compile just fine. This class is the only one that was changed. Any reason to why this is happening?The text was updated successfully, but these errors were encountered: