[FIR] Add desugaring of array assignments and resolve of it

#KT-37516 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-03-16 17:00:08 +03:00
parent 26f919df03
commit 2b986194fb
41 changed files with 608 additions and 233 deletions
@@ -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
View File
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
fun box () : String {
val s = ArrayList<String>()
-1
View File
@@ -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
View File
@@ -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)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
class Host(var value: String) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class X {
var result: String = "fail"
@@ -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"