JVM don't use indy by default for SAM conversions (wait for KT-44844)
KT-44278 KT-26060 KT-42621
This commit is contained in:
@@ -211,10 +211,13 @@ class GenerationState private constructor(
|
|||||||
val fromConfig = configuration.get(JVMConfigurationKeys.SAM_CONVERSIONS)
|
val fromConfig = configuration.get(JVMConfigurationKeys.SAM_CONVERSIONS)
|
||||||
if (fromConfig != null && target >= fromConfig.minJvmTarget)
|
if (fromConfig != null && target >= fromConfig.minJvmTarget)
|
||||||
fromConfig
|
fromConfig
|
||||||
else if (target >= JvmTarget.JVM_1_8 && languageVersionSettings.supportsFeature(LanguageFeature.SamWrapperClassesAreSynthetic))
|
else {
|
||||||
JvmClosureGenerationScheme.INDY
|
// TODO wait for KT-44844 (properly support 'invokedynamic' in JPS incremental compilation)
|
||||||
else
|
// Use JvmClosureGenerationScheme.INDY if
|
||||||
|
// JVM target is at least JVM_1_8 &&
|
||||||
|
// SamWrapperClassesAreSynthetic language feature is supported
|
||||||
JvmClosureGenerationScheme.CLASS
|
JvmClosureGenerationScheme.CLASS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val lambdasScheme = run {
|
val lambdasScheme = run {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// SAM_CONVERSIONS: CLASS
|
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS
|
||||||
// FILE: samAdapterForJavaInterfaceWithNullability.kt
|
// FILE: samAdapterForJavaInterfaceWithNullability.kt
|
||||||
fun testNullable(s: String) = JNullable { s }
|
fun testNullable(s: String) = JNullable { s }
|
||||||
fun testNotNull(s: String) = JNotNull { s }
|
fun testNotNull(s: String) = JNotNull { s }
|
||||||
|
|||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
@kotlin.Metadata
|
|
||||||
public final class SamAdapterForJavaInterfaceWithNullabilityKt {
|
|
||||||
// source: 'samAdapterForJavaInterfaceWithNullability.kt'
|
|
||||||
private final static method testNoAnnotation$lambda-2(p0: java.lang.String): java.lang.String
|
|
||||||
public final static @org.jetbrains.annotations.NotNull method testNoAnnotation(@org.jetbrains.annotations.NotNull p0: java.lang.String): JNoAnnotation
|
|
||||||
private final static method testNotNull$lambda-1(p0: java.lang.String): java.lang.String
|
|
||||||
public final static @org.jetbrains.annotations.NotNull method testNotNull(@org.jetbrains.annotations.NotNull p0: java.lang.String): JNotNull
|
|
||||||
private final static method testNullable$lambda-0(p0: java.lang.String): java.lang.String
|
|
||||||
public final static @org.jetbrains.annotations.NotNull method testNullable(@org.jetbrains.annotations.NotNull p0: java.lang.String): JNullable
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=INDY
|
||||||
// FILE: JFoo.java
|
// FILE: JFoo.java
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=INDY
|
||||||
// FILE: JFoo.java
|
// FILE: JFoo.java
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=INDY
|
||||||
// FILE: JFoo.java
|
// FILE: JFoo.java
|
||||||
|
|
||||||
public class JFoo {
|
public class JFoo {
|
||||||
|
|||||||
Reference in New Issue
Block a user