FIR: Add missing iterator function to array types in IrBuiltInsOverFir

Fixes part of KT-57627
This commit is contained in:
Steven Schäfer
2022-11-15 18:50:32 +01:00
committed by Space Team
parent c695da1bed
commit 37bbf447a3
13 changed files with 265 additions and 15 deletions
@@ -0,0 +1,33 @@
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Array modality:FINAL visibility:public superTypes:[kotlin.Any; kotlin.Cloneable; java.io.Serializable]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:kotlin.Array<T of kotlin.Array>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR BUILTIN_CLASS_CONSTRUCTOR visibility:public <> (size:kotlin.Int) returnType:kotlin.Array [primary]
VALUE_PARAMETER BUILTIN_CLASS_CONSTRUCTOR name:size index:0 type:kotlin.Int
FUN BUILTIN_CLASS_METHOD name:get visibility:public modality:FINAL <> ($this:kotlin.Array, index:kotlin.Int) returnType:T of kotlin.Array [operator]
$this: VALUE_PARAMETER name:$this type:kotlin.Array
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int
FUN BUILTIN_CLASS_METHOD name:set visibility:public modality:FINAL <> ($this:kotlin.Array, index:kotlin.Int, value:T of kotlin.Array) returnType:kotlin.Unit [operator]
$this: VALUE_PARAMETER name:$this type:kotlin.Array
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:value index:1 type:T of kotlin.Array
PROPERTY name:size visibility:public modality:FINAL [val]
FUN name:<get-size> visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.Int
correspondingProperty: PROPERTY name:size visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:$this type:kotlin.Array
FUN BUILTIN_CLASS_METHOD name:iterator visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.collections.Iterator<T of kotlin.Array> [operator]
annotations:
IntrinsicConstEvaluation
$this: VALUE_PARAMETER name:$this type:kotlin.Array
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:$this type:kotlin.Any
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:$this type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:$this type:kotlin.Any
@@ -0,0 +1,39 @@
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Array modality:FINAL visibility:public superTypes:[kotlin.Any; kotlin.Cloneable; java.io.Serializable]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Array<T of kotlin.Array>
TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> (size:kotlin.Int, init:kotlin.Function1<kotlin.Int, T of kotlin.Array>) returnType:kotlin.Array<T of kotlin.Array>
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:size index:0 type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:init index:1 type:kotlin.Function1<kotlin.Int, T of kotlin.Array>
PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val]
FUN IR_EXTERNAL_DECLARATION_STUB name:<get-size> visibility:public modality:FINAL <> ($this:kotlin.Array<T of kotlin.Array>) returnType:kotlin.Int
correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Array<T of kotlin.Array>
FUN IR_EXTERNAL_DECLARATION_STUB name:clone visibility:public modality:OPEN <> ($this:kotlin.Array<T of kotlin.Array>) returnType:kotlin.Array<T of kotlin.Array>
overridden:
protected open fun clone (): kotlin.Any declared in kotlin.Cloneable
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Array<T of kotlin.Array>
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Cloneable
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.Array<T of kotlin.Array>, index:kotlin.Int) returnType:T of kotlin.Array [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Array<T of kotlin.Array>
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:index index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Cloneable
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN IR_EXTERNAL_DECLARATION_STUB name:iterator visibility:public modality:FINAL <> ($this:kotlin.Array<T of kotlin.Array>) returnType:kotlin.collections.Iterator<T of kotlin.Array> [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Array<T of kotlin.Array>
FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.Array<T of kotlin.Array>, index:kotlin.Int, value:T of kotlin.Array) returnType:kotlin.Unit [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Array<T of kotlin.Array>
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:index index:0 type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:value index:1 type:T of kotlin.Array
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Cloneable
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
@@ -0,0 +1,32 @@
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:IntArray modality:FINAL visibility:public superTypes:[kotlin.Any; kotlin.Cloneable; java.io.Serializable]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:kotlin.IntArray
CONSTRUCTOR BUILTIN_CLASS_CONSTRUCTOR visibility:public <> (size:kotlin.Int) returnType:kotlin.IntArray [primary]
VALUE_PARAMETER BUILTIN_CLASS_CONSTRUCTOR name:size index:0 type:kotlin.Int
FUN BUILTIN_CLASS_METHOD name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:$this type:kotlin.IntArray
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int
FUN BUILTIN_CLASS_METHOD name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator]
$this: VALUE_PARAMETER name:$this type:kotlin.IntArray
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:value index:1 type:kotlin.Int
PROPERTY name:size visibility:public modality:FINAL [val]
FUN name:<get-size> visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.Int
correspondingProperty: PROPERTY name:size visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:$this type:kotlin.IntArray
FUN BUILTIN_CLASS_METHOD name:iterator visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.collections.IntIterator [operator]
annotations:
IntrinsicConstEvaluation
$this: VALUE_PARAMETER name:$this type:kotlin.IntArray
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:$this type:kotlin.Any
VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:$this type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:$this type:kotlin.Any
@@ -0,0 +1,40 @@
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:IntArray modality:FINAL visibility:public superTypes:[kotlin.Any; kotlin.Cloneable; java.io.Serializable]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.IntArray
CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> (size:kotlin.Int, init:kotlin.Function1<kotlin.Int, kotlin.Int>) returnType:kotlin.IntArray
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:size index:0 type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:init index:1 type:kotlin.Function1<kotlin.Int, kotlin.Int>
CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> (size:kotlin.Int) returnType:kotlin.IntArray [primary]
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:size index:0 type:kotlin.Int
PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val]
FUN IR_EXTERNAL_DECLARATION_STUB name:<get-size> visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.Int
correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.IntArray
FUN IR_EXTERNAL_DECLARATION_STUB name:clone visibility:public modality:OPEN <> ($this:kotlin.IntArray) returnType:kotlin.IntArray
overridden:
protected open fun clone (): kotlin.Any declared in kotlin.Cloneable
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.IntArray
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Cloneable
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.IntArray
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:index index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Cloneable
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN IR_EXTERNAL_DECLARATION_STUB name:iterator visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.collections.IntIterator [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.IntArray
FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.IntArray
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:index index:0 type:kotlin.Int
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:value index:1 type:kotlin.Int
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
public open fun toString (): kotlin.String [fake_override] declared in kotlin.Cloneable
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
@@ -0,0 +1,26 @@
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:IntIterator modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:kotlin.collections.IntIterator
CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> () returnType:kotlin.collections.IntIterator [primary]
FUN IR_EXTERNAL_DECLARATION_STUB name:next visibility:public modality:FINAL <> ($this:kotlin.collections.IntIterator) returnType:kotlin.Int [operator]
overridden:
public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.collections.IntIterator
FUN IR_EXTERNAL_DECLARATION_STUB name:nextInt visibility:public modality:ABSTRACT <> ($this:kotlin.collections.IntIterator) returnType:kotlin.Int
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.collections.IntIterator
FUN FAKE_OVERRIDE name:hasNext visibility:public modality:ABSTRACT <> ($this:kotlin.collections.IntIterator) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.collections.IntIterator
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.collections.IntIterator, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.collections.IntIterator
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.collections.IntIterator) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.collections.IntIterator
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.collections.IntIterator) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.collections.IntIterator
@@ -0,0 +1,26 @@
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:IntIterator modality:ABSTRACT visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.collections.IntIterator
CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> () returnType:kotlin.collections.IntIterator [primary]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hasNext visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Iterator<kotlin.Int>) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.collections.Iterator<kotlin.Int>
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN IR_EXTERNAL_DECLARATION_STUB name:next visibility:public modality:FINAL <> ($this:kotlin.collections.IntIterator) returnType:kotlin.Int [operator]
overridden:
public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.collections.IntIterator
FUN IR_EXTERNAL_DECLARATION_STUB name:nextInt visibility:public modality:ABSTRACT <> ($this:kotlin.collections.IntIterator) returnType:kotlin.Int
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.collections.IntIterator
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.Iterator
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
@@ -0,0 +1,12 @@
FILE fqName:<root> fileName:/arraysFromBuiltins.kt
PROPERTY name:test visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.collections.IntIterator visibility:private [final,static]
EXPRESSION_BODY
CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null
$this: CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int) [primary] declared in kotlin.IntArray' type=kotlin.IntArray origin=null
size: CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test> visibility:public modality:FINAL <> () returnType:kotlin.collections.IntIterator
correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test> (): kotlin.collections.IntIterator declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.collections.IntIterator visibility:private [final,static]' type=kotlin.collections.IntIterator origin=null
@@ -0,0 +1,7 @@
// FIR_IDENTICAL
// DUMP_EXTERNAL_CLASS: kotlin/Array
// DUMP_EXTERNAL_CLASS: kotlin/IntArray
// DUMP_EXTERNAL_CLASS: kotlin/collections/IntIterator
// TARGET_BACKEND: JVM_IR
val test = IntArray(1).iterator()
@@ -0,0 +1,3 @@
val test: IntIterator
field = IntArray(size = 1).iterator()
get