encountered an error with Kotlin 2.0.0-RC2 that wa...
# k2-adopters
e
encountered an error with Kotlin 2.0.0-RC2 that was extremely difficult to track down
Copy code
// module :a
sealed class AResult<T> { ... }

// module :b, dependencies { implementation(":a") }
sealed class BResult<T> { ... }
suspend fun service() = ... // BResult<AResult<...>>, not written explicitly

// module :c, dependencies { implementation(":b") }
when (service()) {
    is BResult.Success -> ...
this failed with
IllegalStateException: Can't find KotlinType in IrErrorType: IrErrorType(null)
and a huge stacktrace, nothing mentioning the non-exposed
AResult
type as the problem
obviously this was a problem in our codebase but it took a lot of investigation to find
it worked without issue in K1
o
Thanks for sharing! Did you open an issue on YouTrack?
m
plus one Yes, it would be great to open an issue