7b5544ebd3
In cases when the test has the JVM_TARGET directive, use that one for Java compilation as well. Otherwise, for box tests, the corresponding test in `JvmTarget6OnJvm6` (module `:compiler:tests-different-jdk`) will fail. However, it affects all codegen tests, so fix a bunch of them which use Java 8+ features to explicitly compile with JVM target 1.8. In particular, this obsoletes the SKIP_JDK6 directive in those tests because "JVM_TARGET: 1.8" also skips it for JDK 6. The check for IS_SOURCE_6_STILL_SUPPORTED is needed in order to still be able to run tests in the project while only having a single JDK > 11 installed, and having all of the env vars JDK_16, JDK_17, JDK_18 pointing to that JDK.
47 lines
932 B
Kotlin
Vendored
47 lines
932 B
Kotlin
Vendored
// FILE: kt43217.kt
|
|
// JVM_TARGET: 1.8
|
|
class A {
|
|
private val b =
|
|
object : DoubleExpression() {
|
|
override fun get(): Double {
|
|
return 0.0
|
|
}
|
|
}
|
|
}
|
|
|
|
class C : DoubleExpression() {
|
|
override fun get() = 0.0
|
|
}
|
|
|
|
// FILE: DoubleExpression.java
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public abstract class DoubleExpression implements ObservableDouble {
|
|
@NotNull
|
|
@Override
|
|
public Object isEqualTo(double value) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
// FILE: ObservableValue.java
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public interface ObservableValue<T> {
|
|
@NotNull
|
|
T get();
|
|
|
|
@NotNull
|
|
default Object isEqualTo(@NotNull T value) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
// FILE: ObservableDouble.java
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public interface ObservableDouble extends ObservableValue<Double> {
|
|
@NotNull
|
|
Object isEqualTo(double value);
|
|
}
|