I just ran into the same KAPT error on a seemingly...
# arrow
u
I just ran into the same KAPT error on a seemingly unrelated piece of code. Looking at the actual class, it turns out that the Java code for the `NonEmptySet<T>`` seemed to be the problem. An explicit type annotation for the set made the error disappear. No Idea if this is in any way helpful for your problem, though.
🙌 1
m
that is a helpful hint! Unfortunately in this case, having a type annotation was the whole point so I wouldn't have to implement this method separately for each type 😬 But I'll give it a try to further narrow it down 👍
Update: changing
NonEmptySet<T>
to a specific
NonEmptySet<DataResource>
didn't fix the issue. Looks like I might have to replace
NonEmptySet
with a regular
Set
or
List
for now... 🤔 Update 2: when replacing ``NonEmptySet` with
Set
, it compiles fine again.
a
this is a very weird error we find from time to time and we don't really know how to solve... it seems to be related to the difference in name between the declaration of a type and extension functions, but we've never been able to understand the whole thing
😬 1
m
I just ran into a related issue: when trying to use mockk to mock a class that uses
NonEmptySet
, it became unable to properly register the mock. Then we changed the signature to use a regular
Set
and everything worked again.
s
That sounds like a bug between
@JvmInline value class
and Mockk 🤔 but can't find to find an issue ticket for it. Does Mockk work with inline classes?
i
I'm not sure whether these cover your issue, but I know there's at least two open issues for the latest version of MockK regarding value classes: • https://github.com/mockk/mockk/issues/1232https://github.com/mockk/mockk/issues/1225 The latter has a merged PR awaiting release.
1
☝️ 1