Copy methods for lambdas to DefaultImpls without receiver transformation

#KT-48230 Fixed
This commit is contained in:
Mikhael Bogdanov
2021-08-17 12:22:05 +02:00
committed by Space
parent 6d7eb2bd21
commit a5e59e09ee
25 changed files with 111 additions and 19 deletions
@@ -50,7 +50,7 @@ FILE fqName:<root> fileName:/noSymbolForIntRangeIterator.kt
CONST Int type=kotlin.Int value=10
VAR name:y type:kotlin.Int [val]
CONST Int type=kotlin.Int value=10
FUN name:localFunc visibility:local modality:FINAL <> () returnType:kotlin.Unit
FUN LOCAL_FUNCTION name:localFunc visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.IntIterator [val]
@@ -0,0 +1,14 @@
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
inline fun withO(block: String.() -> String) = "O".block()
// FILE: 2.kt
interface I {
val k: String
fun foo() = withO(fun String.(): String { return this + k })
}
fun box(): String = object : I {
override val k = "K"
}.foo()