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

Gopal S Akshintala

05/19/2021, 7:53 AM
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

christophsturm

05/19/2021, 7:56 AM
do you have coroutines in your test dependencies? from the error it seems that adding it could fix it
g

Gopal S Akshintala

05/19/2021, 8:14 AM
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

christophsturm

05/19/2021, 8:30 AM
i think if you add coroutines as a test dependency the error will go away
g

Gopal S Akshintala

05/19/2021, 8:49 AM
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

sam

05/19/2021, 11:38 AM
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

Gopal S Akshintala

05/19/2021, 12:15 PM
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

sam

05/19/2021, 12:18 PM
I will clone and test. What command are you using in gradle?
g

Gopal S Akshintala

05/19/2021, 12:19 PM
gradle clean build
Gradle version I have is 7.0, with jvm 16.0.1
Thanks!
s

sam

05/19/2021, 12:24 PM
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

Gopal S Akshintala

05/19/2021, 2:34 PM
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
13 Views