Add flag for proper array convention with default args calls

This commit is contained in:
Mikhael Bogdanov
2020-05-11 10:18:08 +02:00
committed by Mikhail Bogdanov
parent adc770b604
commit 5ef37148ea
10 changed files with 69 additions and 17 deletions
@@ -1,3 +1,4 @@
// !LANGUAGE: +ProperArrayConventionSetterWithDefaultCalls
// IGNORE_BACKEND_FIR: JVM_IR
var inc: String = ""
@@ -1,3 +1,4 @@
// !LANGUAGE: +ProperArrayConventionSetterWithDefaultCalls
// IGNORE_BACKEND_FIR: JVM_IR
var result = "fail"
@@ -0,0 +1,20 @@
// !LANGUAGE: -ProperArrayConventionSetterWithDefaultCalls
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
var result = "fail"
class A {
operator fun set(
i1: Int,
i2: Int = 1,
v: String
) {
result = "" + i1 + i2 + v
}
}
fun box(): String {
A()[1] = "OK"
return if (result != "10OK") "fail: $result" else "OK"
}
@@ -1,3 +1,4 @@
// !LANGUAGE: +ProperArrayConventionSetterWithDefaultCalls
// IGNORE_BACKEND_FIR: JVM_IR
var inc: String = ""