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)
|
||||
if (fromConfig != null && target >= fromConfig.minJvmTarget)
|
||||
fromConfig
|
||||
else if (target >= JvmTarget.JVM_1_8 && languageVersionSettings.supportsFeature(LanguageFeature.SamWrapperClassesAreSynthetic))
|
||||
JvmClosureGenerationScheme.INDY
|
||||
else
|
||||
else {
|
||||
// TODO wait for KT-44844 (properly support 'invokedynamic' in JPS incremental compilation)
|
||||
// Use JvmClosureGenerationScheme.INDY if
|
||||
// JVM target is at least JVM_1_8 &&
|
||||
// SamWrapperClassesAreSynthetic language feature is supported
|
||||
JvmClosureGenerationScheme.CLASS
|
||||
}
|
||||
}
|
||||
|
||||
val lambdasScheme = run {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// SAM_CONVERSIONS: CLASS
|
||||
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS
|
||||
// FILE: samAdapterForJavaInterfaceWithNullability.kt
|
||||
fun testNullable(s: String) = JNullable { 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
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=INDY
|
||||
// FILE: JFoo.java
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=INDY
|
||||
// FILE: JFoo.java
|
||||
|
||||
public class JFoo {
|
||||
|
||||
Reference in New Issue
Block a user