JVM IR: fix value argument offset in -Xjvm-default=compatibility mode
This commit is contained in:
+5
-2
@@ -17,7 +17,10 @@ import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionReference
|
||||
import org.jetbrains.kotlin.ir.expressions.IrReturn
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrLocalDelegatedPropertySymbol
|
||||
@@ -218,7 +221,7 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran
|
||||
offset += 1
|
||||
}
|
||||
for (i in offset until valueParameters.size) {
|
||||
call.putValueArgument(i - 1, IrGetValueImpl(startOffset, endOffset, valueParameters[i].symbol))
|
||||
call.putValueArgument(i - offset, IrGetValueImpl(startOffset, endOffset, valueParameters[i].symbol))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+4
-2
@@ -5,8 +5,10 @@
|
||||
// WITH_RUNTIME
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun String.foo() = "OK"
|
||||
fun String.foo(k: String) = "O" + k
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
object : A { fun box() = "FAIL".foo() }.box()
|
||||
object : A {
|
||||
fun box() = "FAIL".foo("K")
|
||||
}.box()
|
||||
|
||||
Reference in New Issue
Block a user