JVM_IR: move ArrayConstructor below function reference phases

This allows taking function references to inline array constructors.

Also, redundant classes are no longer generated when function references
are passed as arguments to the array constructors.

 #KT-46426 Fixed
This commit is contained in:
pyos
2021-05-04 16:13:39 +02:00
committed by TeamCityServer
parent 776920f77d
commit 9f53d70109
15 changed files with 168 additions and 45 deletions
@@ -0,0 +1,10 @@
// WITH_RUNTIME
class C(val x: String) {
fun foo(i: Int): Char = x[i]
}
fun box(): String {
val array = CharArray(2, C("OK")::foo)
return array[0].toString() + array[1].toString()
}