Closed kzotin closed 5 years ago
Hello again, :)
since our support for Kotlin is in its infants, I would need a bit more time to find out what this means for us and how we can make this work™. I would kindly ask you to give me like a week and I gladly will come back with an idea...
Would you have a suggestion on how to approach the problem?
Greetings, Mario
My quick guess is that with java List type is passed to compiler as: List<Resource>
With Kotlin it's more explicit: List<? extends com.contentful.vault.Resource>
.
And then some dark magic is happening here which returns false
for kotlin version:
https://github.com/contentful/vault/blob/master/compiler/src/main/java/com/contentful/vault/compiler/Processor.java#L380
Try to add @JvmSuppressWildcards
annotation like this
@JvmField @Field var content: List<@JvmSuppressWildcards Resource>? = null
@bizon91 kudos for advice, it helped!
< closing this issue due to inactivity and seemingly finding a solution >
Hi folks, Sorry, it's me again :)
After migrating Vault models to Kotlin, we're facing issue with
List<Resources>
field. We're declaring field in following way:@JvmField @Field var content: List<Resource>? = null
FAILURE: Build failed with an exception:
Possible cause: https://github.com/contentful/vault/blob/master/compiler/src/main/java/com/contentful/vault/compiler/Processor.java#L284