Open mr3y-the-programmer opened 1 year ago
Seems to be a change in ksp where it's returning an error type where it was resolved before. Either a bug in ksp or this project, if you could narrow it down to a sample that would be super helpful
I'm having a hard time isolating the bug into its own small sample, but here is the project https://github.com/mr3y-the-programmer/Ludi/pull/60 that is reproducing the bug. reproducing the error is fairly simple, just clone the repository, checkout bump_kotlin_version
branch, run .\gradlew :shared:kspKotlinDesktop
and you should see the error.
FYI, if you downgraded KSP version to 1.9.10-1.0.13, kspKotlinDesktop
completes successfully with no issues. version 1.9.20-RC2-1.0.13
is the first one that can reproduce the bug, this commit seems to be the culprit.
Finally got around to looking at this, it's failing to resolve types generated by wire. You can get around this by wrapping those types when providing them, ex:
@JvmInline
value class UserFavoriteGamesDataStore(val value: DataStore<UserFavouriteGame>)
interface DataStoreComponent {
@Provides
@Singleton
fun provideFavouriteGamesDataStore(dataStoreParentDir: Path): UserFavoriteGamesDataStore {
...
}
}
Will work on better error messages for unresolved types, but I don't know if there's a good solution to making those types resolvable as wire is a gradle plugin and ksp doesn't know about it. This is similar to https://github.com/evant/kotlin-inject/issues/155
Thanks for your effort, will try this workaround.
I seem to be getting the same error when trying to inject a Map<String, Foo<*>>... even if I wrap it in a value class or a data class... I'm on Kotlin 1.9.22/23 with corresponding latest ksp version and kotlinInject 0.6.3
Nope, it was an error in my code, that I didn't use <*> in all of the occurences of the use of that base class. But that's a funny error for this kind of problem...
After I bumped kotlin version to 1.9.20 & ksp as well in a project where I'm using kotlin-inject, I can't compile the desktop app anymore due to this error:
At first look, Seems like it is Kotlinpoet's fault but I'm not sure.