Has anyone faced this error with latest Kotest: 4....
# kotest
g
Has anyone faced this error with latest Kotest: 4.6.0 with Gradle 7.0, gradle-jvm:16, Kotlin: 1.6, Java: 16
Copy code
Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class io.kotest.core.test.TestContext, unresolved supertypes: kotlinx.coroutines.CoroutineScope
Adding -Xextended-compiler-checks argument might provide additional information.
c
do you have coroutines in your test dependencies? from the error it seems that adding it could fix it
g
No I dnt hv coroutines
let me share my gradle file
I tried with
4.6.0
as well as the
4.7-snapshot
of kotest
only kotest in my dependencies uses coroutines
from the error, it looks like something to do with Kotest @christophsturm
c
i think if you add coroutines as a test dependency the error will go away
g
No it didn’t work! I get a stackoverflow ` at org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitor.spillVariables$findSuspensionPointPredecessors$dfs(CoroutineTransformerMethodVisitor.kt:722)
Looks like a known issue: CompilationException: Back-end (JVM) Internal error: wrong bytecode generated (with coroutines) : KT-39285 (jetbrains.com)
But shouldn’t Kotest take care of coroutine dependency?
s
Coroutines should be included - sounds like a version clash as 4.6 is using 1.5 of coroutines
What version of kotlin are you using
g
I use Kotlin 1.5 as well
You may find my Gradle file here, I control version from gradle.properties : https://github.com/overfullstack/ds-algo/blob/master/build.gradle.kts
s
I will clone and test. What command are you using in gradle?
g
gradle clean build
Gradle version I have is 7.0, with jvm 16.0.1
Thanks!
s
Copy code
➜  /home/sam/development/workspace/kotest/ds-algo git:(master) ./gradlew clean build
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileKotlin
w: /home/sam/development/workspace/kotest/ds-algo/src/main/kotlin/hackerrank/Abbrevation.kt: (22, 26): 'toUpperCase(): Char' is deprecated. Use uppercaseChar() instead.
w: /home/sam/development/workspace/kotest/ds-algo/src/main/kotlin/hackerrank/greedy/LuckBalance.kt: (5, 21): 'sumBy((T) -> Int): Int' is deprecated. Use sumOf instead.
w: /home/sam/development/workspace/kotest/ds-algo/src/main/kotlin/hackerrank/greedy/LuckBalance.kt: (6, 44): 'sumBy((T) -> Int): Int' is deprecated. Use sumOf instead.
w: /home/sam/development/workspace/kotest/ds-algo/src/main/kotlin/leetcode/graph/CourseSchedule.kt: (8, 15): Parameter 'numCourses' is never used

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> error: invalid source release: 16
Trying 1.8
Oh this is a java project
I will need to upgrade my version of java
g
It's a mixed project with java and Kotlin
Now i get this error in my other project as well which uses java 11
I observed this error started after I used kotest-gradle plugin