diff --git a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmClosureGenerationScheme.kt b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmClosureGenerationScheme.kt index 70d950979a5..a03ab246059 100644 --- a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmClosureGenerationScheme.kt +++ b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmClosureGenerationScheme.kt @@ -17,7 +17,9 @@ enum class JvmClosureGenerationScheme( val DEFAULT = CLASS @JvmStatic - fun fromString(string: String?) = - values().find { it.description == string } + fun fromString(string: String?): JvmClosureGenerationScheme? { + val lowerStr = string?.toLowerCase() ?: return null + return values().find { it.description == lowerStr } + } } } \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.kt index 5686fc2bcb1..a2d47698ac1 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.kt index 0e255f086a2..ba84bcee015 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.kt index 163b33e639e..7f660ec5ac6 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.kt index d403207631f..40aa971bbd2 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.kt index f41de2181c4..da1d072138c 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.kt index edbb878fe04..94cb400b9c0 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/kt16650.kt b/compiler/testData/codegen/bytecodeListing/sam/kt16650.kt index 8a0e7b6a313..1226b92332f 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/kt16650.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/kt16650.kt @@ -1,4 +1,4 @@ -// SAM_CONVERSIONS: CLASS +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt fun main(x: DataStream) { diff --git a/compiler/testData/codegen/bytecodeListing/sam/kt16650_ir.txt b/compiler/testData/codegen/bytecodeListing/sam/kt16650_ir.txt index 1b1bb19c3cc..50b30869177 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/kt16650_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/kt16650_ir.txt @@ -1,7 +1,31 @@ +@kotlin.Metadata +final class<Ljava/lang/Object;LKeySelector;> TKt$main$1 { + // source: 't.kt' + static method (): void + method (): void + public final method getKey(p0: java.lang.Integer): java.lang.Long + public synthetic bridge method getKey(p0: java.lang.Object): java.lang.Object + enclosing method TKt.main(LDataStream;)V + public final static field ;> INSTANCE: TKt$main$1 + inner (anonymous) class TKt$main$1 +} + +@kotlin.Metadata +final class<Ljava/lang/Object;LKeySelector;> TKt$main$2 { + // source: 't.kt' + static method (): void + method (): void + public final method getKey(p0: java.lang.Integer): java.lang.Long + public synthetic bridge method getKey(p0: java.lang.Object): java.lang.Object + enclosing method TKt.main(LDataStream;)V + public final static field ;> INSTANCE: TKt$main$2 + inner (anonymous) class TKt$main$2 +} + @kotlin.Metadata public final class TKt { // source: 't.kt' public final static <(LDataStream;)V> method main(@org.jetbrains.annotations.NotNull p0: DataStream): void - private final static method main$lambda-0(p0: java.lang.Integer): java.lang.Long - private final static method main$lambda-1(p0: java.lang.Integer): java.lang.Long + inner (anonymous) class TKt$main$1 + inner (anonymous) class TKt$main$2 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface.kt index e06a76011af..905fe074852 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface_ir.txt b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface_ir.txt index 06aebcc78e9..58ebc83375c 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericFunInterface_ir.txt @@ -4,10 +4,20 @@ public interface<Ljava/lang/Object;> Sam { public abstract <()TT;> method get(): java.lang.Object } +@kotlin.Metadata +final class<Ljava/lang/Object;LSam;> TKt$genericSamGet$1 { + // source: 't.kt' + public final <()TT;> method get(): java.lang.Object + <(Lkotlin/jvm/functions/Function0<+TT;>;)V> method (p0: kotlin.jvm.functions.Function0): void + enclosing method TKt.genericSamGet(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object; + synthetic final field ;> $f: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$genericSamGet$1 +} + @kotlin.Metadata public final class TKt { // source: 't.kt' public final static <(LSam;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object - private final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSamGet$lambda-0(p0: kotlin.jvm.functions.Function0): java.lang.Object public final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSamGet(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object + inner (anonymous) class TKt$genericSamGet$1 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface.kt index 9720eeec38e..7b378b3679a 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface_ir.txt b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface_ir.txt index 7c5f65a0533..023cc600dfa 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaGenericSamInterface_ir.txt @@ -1,8 +1,28 @@ +@kotlin.Metadata +final class<Ljava/lang/Object;LSam;> TKt$genericSam$1 { + // source: 't.kt' + public final <()TT;> method get(): java.lang.Object + <(Lkotlin/jvm/functions/Function0<+TT;>;)V> method (p0: kotlin.jvm.functions.Function0): void + enclosing method TKt.genericSam(Lkotlin/jvm/functions/Function0;)LSam; + synthetic final field ;> $f: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$genericSam$1 +} + +@kotlin.Metadata +final class<Ljava/lang/Object;LSam;> TKt$genericSamGet$1 { + // source: 't.kt' + public final <()TT;> method get(): java.lang.Object + <(Lkotlin/jvm/functions/Function0<+TT;>;)V> method (p0: kotlin.jvm.functions.Function0): void + enclosing method TKt.genericSamGet(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object; + synthetic final field ;> $f: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$genericSamGet$1 +} + @kotlin.Metadata public final class TKt { // source: 't.kt' public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0<+TT;>;)LSam;> method genericSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): Sam - private final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSam$lambda-0(p0: kotlin.jvm.functions.Function0): java.lang.Object - private final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSamGet$lambda-1(p0: kotlin.jvm.functions.Function0): java.lang.Object public final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSamGet(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object + inner (anonymous) class TKt$genericSam$1 + inner (anonymous) class TKt$genericSamGet$1 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface.kt index 7cb672329d5..1ef76184990 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface.kt @@ -1,4 +1,4 @@ - +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface_ir.txt b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface_ir.txt index 9d30b5549c0..8020d43de86 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedFunInterface_ir.txt @@ -4,10 +4,21 @@ public interface<Ljava/lang/Object;> Sam { public abstract <()TT;> method get(): java.lang.Object } +@kotlin.Metadata +final class<Ljava/lang/Object;LSam;> TKt$specializedSam$1 { + // source: 't.kt' + <(Lkotlin/jvm/functions/Function0;)V> method (p0: kotlin.jvm.functions.Function0): void + public synthetic bridge method get(): java.lang.Object + public final @org.jetbrains.annotations.NotNull method get(): java.lang.String + enclosing method TKt.specializedSam(Lkotlin/jvm/functions/Function0;)Ljava/lang/String; + synthetic final field ;> $f: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$specializedSam$1 +} + @kotlin.Metadata public final class TKt { // source: 't.kt' - private final static <(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;> method specializedSam$lambda-0(p0: kotlin.jvm.functions.Function0): java.lang.String public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String public final static <(LSam;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object + inner (anonymous) class TKt$specializedSam$1 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface.kt index 185c15d0e83..16a96f79fb6 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface_ir.txt b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface_ir.txt index 6274ccb7d0b..9333ea1d30f 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/lambdaSpecializedSamInterface_ir.txt @@ -1,6 +1,17 @@ +@kotlin.Metadata +final class<Ljava/lang/Object;LSam;> TKt$specializedSam$1 { + // source: 't.kt' + <(Lkotlin/jvm/functions/Function0;)V> method (p0: kotlin.jvm.functions.Function0): void + public synthetic bridge method get(): java.lang.Object + public final method get(): java.lang.String + enclosing method TKt.specializedSam(Lkotlin/jvm/functions/Function0;)Ljava/lang/String; + synthetic final field ;> $f: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$specializedSam$1 +} + @kotlin.Metadata public final class TKt { // source: 't.kt' - private final static <(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;> method specializedSam$lambda-0(p0: kotlin.jvm.functions.Function0): java.lang.String public final static <(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String + inner (anonymous) class TKt$specializedSam$1 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.kt b/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.kt index 9db99e321b9..536a27e6b15 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_RUNTIME class A { diff --git a/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.kt b/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.kt index 5fb0edbf713..8aac7428cfe 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES package test diff --git a/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.kt index 150cd5d58d4..29fe54748b5 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.kt b/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.kt index 72ecaa94f56..47b7a58da68 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS // WITH_SIGNATURES // FILE: t.kt diff --git a/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.kt b/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.kt index dadc316c73e..77b7431c89a 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.kt +++ b/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.kt @@ -1,3 +1,4 @@ +// KOTLIN_CONFIGURATION_FLAGS: SAM_CONVERSIONS=CLASS class A { fun test1a() = B().runnable1() fun test1b() = B().runnable1()