Just bumped to Kotlin `1.7.0` and am seeing this i...
# kotest
j
Just bumped to Kotlin
1.7.0
and am seeing this in Kotest:
Copy code
Found interface kotlin.time.TimeMark, but class was expected
java.lang.IncompatibleClassChangeError: Found interface kotlin.time.TimeMark, but class was expected
	at io.kotest.engine.spec.interceptor.SpecFinishedInterceptor.intercept-0E7RQCE(SpecFinishedInterceptor.kt:37)
	at io.kotest.engine.spec.interceptor.SpecFinishedInterceptor$intercept$1.invokeSuspend(SpecFinishedInterceptor.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
do I need to wait for a new Kotest version? ** Not a contribution
Found https://github.com/kotest/kotest/issues/2960. Sounds like I need to just wait until a new release of Kotest is cut!
s
Yep aiming for this weekend
s
The Kotest plugin seems to crash highlighting in IntelliJ, too, for a Kotlin 1.7.0 project. I assume that has the same root cause.
t
Any news about this issue?
s
There's a 5.3.1 release in progress that has 1.7 support.
🎉 5
s
Any news about this? I ran into this today with Kotest 5.4.5 and Kotlin 1.8.0 😞 I really want to use
kotlin.time.*
😭 This package has been incredibly unstable since it was first added in 1.3 😕
s
Use it in which place?
s
In a library ><
s
Oh and kotest is holding you back
s
Yes, my tests are failing with the
Found interface kotlin.time.TimeMark, but class was expected
error.
s
I'm waiting for compiler plugin api to go stable. Did you hear anything about that Simon ?
s
Nothing concrete. @dmitriy.novozhilov is talking about that compiler APIs on KotlinConf IIRC. I believe IR is going to be stable before FIR, but not entirely sure. cc\\ @raulraja
s
So not much chance of it being stable by 1.9 then
s
K2 Beta is targeted for 1.9, so I guess not. https://youtrack.jetbrains.com/issue/KT-52604/Release-K2-Beta Do you know about a workaround for the
kotlin.time
conflict?
I'm not entirely sure why Kotest is currently stuck on 1.6. I know it's for compiler compatibility reasons, but don't know the details. IIRC most changes are currently happening in FIR, and not IR and IR is mostly stable. Albeit probably not entirely stable 😞
s
The reason was that last time we bumped from 1.4 to 1.5 to 1.6 a ton of issues occurred. I guess we could release 5.6 targetting 1.8
Part of that was self inflicted because we were using experimental methods, but half the SDK is experimental for like 10 years 😂 And if we want to do JS / native we have no choice on the plugin side.
s
Yes, it's an annoying. I've wanted to leverage plugins for many years, but have sadly stayed away from it for this reason. I hope it stabilises soon 🤞
k
Hey @simon.vergauwen, @sam, I ran into this issue when tried to use
kotlin.time.Duration
in one of the modules (not using Kotest). We’re currently using kotlin
1.6.21
and I’m guessing there’s no point upgrading just to fix this issue as you’re getting same in
1.8.0
. Do you know any workaround? As of now, I simply moved to
java.time.Duration
with coreLibraryDesugaring
1287 Views