compose-destinations
compose-destinations copied to clipboard
KSP Unresolved References for Sealed Class Default Values
When migrating from v1 to v2 KSP fails with "Unresolved reference" errors for sealed class objects used as default values in NavArgs.
Root cause: v2's KSP code generator extracts default values and uses them in generated files, but without explicit imports, they become unqualified and unresolvable.
In v1 I used to do and it worked
enum class class ProfileScreenMode {
Edit
Select
}
data class ProfileSelectScreenNavArgs(
val screenMode: ProfileScreenMode = Select,
val profileId: Int
)
@Destination(navArgs = ProfileSelectScreenNavArgs::class)
@Composable
fun ProfileSelectScreen(....)
now in v2 this doesn't compile because ksp complains about unresolved Select
enum class class ProfileScreenMode {
Edit
Select
}
data class ProfileSelectScreenNavArgs(
val screenMode: ProfileScreenMode = Select,
val profileId: Int
)
@Destination<RootGraph>(navArgs = ProfileSelectScreenNavArgs::class)
@Composable
fun ProfileSelectScreen(....)