https://kotlinlang.org logo
#kotest
Title
# kotest
j

James Eschner

06/09/2022, 4:00 PM
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

sam

06/09/2022, 5:15 PM
Yep aiming for this weekend
s

Sebastian Schuberth

06/09/2022, 5:21 PM
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

thol01

06/13/2022, 11:22 AM
Any news about this issue?
s

sam

06/13/2022, 3:49 PM
There's a 5.3.1 release in progress that has 1.7 support.
🎉 5
s

simon.vergauwen

01/25/2023, 9:27 AM
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

sam

01/25/2023, 9:46 AM
Use it in which place?
s

simon.vergauwen

01/25/2023, 9:47 AM
In a library ><
s

sam

01/25/2023, 11:00 AM
Oh and kotest is holding you back
s

simon.vergauwen

01/25/2023, 11:01 AM
Yes, my tests are failing with the
Found interface kotlin.time.TimeMark, but class was expected
error.
s

sam

01/25/2023, 11:02 AM
I'm waiting for compiler plugin api to go stable. Did you hear anything about that Simon ?
s

simon.vergauwen

01/25/2023, 11:04 AM
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

sam

01/25/2023, 11:07 AM
So not much chance of it being stable by 1.9 then
s

simon.vergauwen

01/25/2023, 2:00 PM
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

sam

01/25/2023, 2:19 PM
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

simon.vergauwen

01/25/2023, 2:22 PM
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

Kshitij Patil

02/20/2023, 2:37 PM
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
971 Views