[FIR] Add desugaring of array assignments and resolve of it
#KT-37516 Fixed
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
fun box(): String {
|
||||
val s = IntArray(1)
|
||||
s[0] = 5
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
operator fun ArrayList<String>.get(index1: Int, index2: Int) = this[index1 + index2]
|
||||
operator fun ArrayList<String>.set(index1: Int, index2: Int, elem: String) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
fun box () : String {
|
||||
val s = ArrayList<String>()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
operator fun IntArray.set(index: Long, elem: Int) { this[index.toInt()] = elem }
|
||||
operator fun IntArray.get(index: Long) = this[index.toInt()]
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
fun box(): String {
|
||||
val array = arrayOf(doubleArrayOf(-1.0))
|
||||
for (node in array) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) = put(key, value)
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Host(var value: String) {
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
class X {
|
||||
var result: String = "fail"
|
||||
|
||||
|
||||
compiler/testData/codegen/box/objects/compoundAssignmentToArrayAccessToPropertyImportedFromObject.kt
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import Host.x
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
object A {
|
||||
operator fun get(i: Int) = 1
|
||||
operator fun set(i: Int, j: Int) {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
fun box(): String {
|
||||
val l = ArrayList<Int>()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
var result = "fail"
|
||||
|
||||
private operator fun X.get(name: String) = name + "K"
|
||||
|
||||
Reference in New Issue
Block a user