Describe the bug
CoroutinesTimeoutExtension uses some "new" APIs:
Optional.or { ... } function which was added in Java 9
Optional.isEmpty() function which was added in Java 11
So effectively the minimal supported JVM version is 11, which is specified in jdk_toolchain_version, while jvmTarget is set to JvmTarget.JVM_1_8.
Provide a Reproducer
- Set the project JVM toolchain to 8
kotlin {
jvmToolchain(8)
}
- Add
@CoroutinesTimeout to any test
- Compile