JVM_IR: refactor ToArrayLowering and make matching more precise

* If `toArray` is inherited from Java, it may take an argument or
    return a value of a flexible type, which looks nullable in IR;
  * The returned array may also have `out` variance of the type
    argument;
  * `Array<T>` is not the same as `Array<Any?>` if `T` is neither `Any`
    nor `in Something`, so presence of `toArray(): Array<T>` does not
    mean we don't need to generate a new `toArray`.
This commit is contained in:
pyos
2020-02-28 10:46:34 +01:00
committed by Alexander Udalov
parent a2b6282d49
commit 20ea77d55d
9 changed files with 157 additions and 180 deletions

View File

@@ -1,4 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IGNORE_LIGHT_ANALYSIS