Skip to content

Commit

Permalink
~~~ Problematic test #1 ~~~
Browse files Browse the repository at this point in the history
  • Loading branch information
mglukhikh committed May 13, 2020
1 parent ed65c0c commit aedfdc6
Show file tree
Hide file tree
Showing 2 changed files with 204 additions and 1 deletion.
13 changes: 12 additions & 1 deletion compiler/testData/ir/irText/expressions/calls.kt
Expand Up @@ -5,4 +5,15 @@ fun qux(x: Int) = foo(foo(x, x), x)

fun Int.ext1() = this
fun Int.ext2(x: Int) = foo(this, x)
fun Int.ext3(x: Int) = foo(ext1(), x)
fun Int.ext3(x: Int) = foo(ext1(), x)

class A : ArrayList<String>() {
override val size: Int get() = super.size + 56
}

fun box(): String {
val a = A()
if (a.size != 56) return "fail: ${a.size}"

return "OK"
}
192 changes: 192 additions & 0 deletions compiler/testData/ir/irText/expressions/calls.txt
Expand Up @@ -43,3 +43,195 @@ FILE fqName:<root> fileName:/calls.kt
x: CALL 'public final fun ext1 (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
$receiver: GET_VAR '<this>: kotlin.Int declared in <root>.ext3' type=kotlin.Int origin=null
y: GET_VAR 'x: kotlin.Int declared in <root>.ext3' type=kotlin.Int origin=null
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[java.util.ArrayList<kotlin.String>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in java.util.ArrayList'
<E>: <none>
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[java.util.ArrayList<kotlin.String>]'
PROPERTY name:size visibility:public modality:FINAL [val]
FUN name:<get-size> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:size visibility:public modality:FINAL [val]
overridden:
public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.MutableCollection
public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.MutableList
public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.MutableList
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-size> (): kotlin.Int declared in <root>.A'
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.Collection' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.<get-size>' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=56
FUN FAKE_OVERRIDE name:elementData visibility:public/*package*/ modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int) returnType:kotlin.String? [fake_override]
overridden:
public/*package*/ open fun elementData (p0: kotlin.Int): E of java.util.ArrayList? declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.Unit [fake_override]
overridden:
public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun contains (p0: kotlin.Any?): kotlin.Boolean [operator] declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Any?) returnType:kotlin.Int [fake_override]
overridden:
public open fun indexOf (p0: kotlin.Any?): kotlin.Int declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Any?) returnType:kotlin.Int [fake_override]
overridden:
public open fun lastIndexOf (p0: kotlin.Any?): kotlin.Int declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.Any [fake_override]
overridden:
public open fun clone (): kotlin.Any declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.Array<out kotlin.Any?>? [fake_override]
overridden:
public open fun toArray (): kotlin.Array<out kotlin.Any?>? declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <T> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Array<out T of <root>.A.toArray?>?) returnType:kotlin.Array<out T of <root>.A.toArray?>? [fake_override]
overridden:
public open fun toArray <T> (p0: kotlin.Array<out T of java.util.ArrayList.toArray?>?): kotlin.Array<out T of java.util.ArrayList.toArray?>? declared in java.util.ArrayList
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Array<out T of <root>.A.toArray?>?
FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int) returnType:kotlin.String? [fake_override,operator]
overridden:
public open fun get (p0: kotlin.Int): E of java.util.ArrayList? [operator] declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int, p1:kotlin.String?) returnType:kotlin.String? [fake_override,operator]
overridden:
public open fun set (p0: kotlin.Int, p1: E of java.util.ArrayList?): E of java.util.ArrayList? [operator] declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
VALUE_PARAMETER name:p1 index:1 type:kotlin.String?
FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.String?) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun add (p0: E of java.util.ArrayList?): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.String?
FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int, p1:kotlin.String?) returnType:kotlin.Unit [fake_override]
overridden:
public open fun add (p0: kotlin.Int, p1: E of java.util.ArrayList?): kotlin.Unit declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
VALUE_PARAMETER name:p1 index:1 type:kotlin.String?
FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int) returnType:kotlin.String? [fake_override]
overridden:
public open fun remove (p0: kotlin.Int): E of java.util.ArrayList? declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun remove (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.Unit [fake_override]
overridden:
public open fun clear (): kotlin.Unit declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.collections.Collection<out kotlin.String?>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun addAll (p0: kotlin.collections.Collection<out E of java.util.ArrayList?>): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<out kotlin.String?>
FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int, p1:kotlin.collections.Collection<out kotlin.String?>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun addAll (p0: kotlin.Int, p1: kotlin.collections.Collection<out E of java.util.ArrayList?>): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
VALUE_PARAMETER name:p1 index:1 type:kotlin.collections.Collection<out kotlin.String?>
FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
VALUE_PARAMETER name:p1 index:1 type:kotlin.Int
FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.collections.Collection<*>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun removeAll (p0: kotlin.collections.Collection<*>): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<*>
FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.collections.Collection<*>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun retainAll (p0: kotlin.collections.Collection<*>): kotlin.Boolean declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<*>
FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int) returnType:kotlin.collections.MutableListIterator<kotlin.String?> [fake_override]
overridden:
public open fun listIterator (p0: kotlin.Int): kotlin.collections.MutableListIterator<E of java.util.ArrayList?> declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.collections.MutableListIterator<kotlin.String?> [fake_override]
overridden:
public open fun listIterator (): kotlin.collections.MutableListIterator<E of java.util.ArrayList?> declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>) returnType:kotlin.collections.MutableIterator<kotlin.String?> [fake_override,operator]
overridden:
public open fun iterator (): kotlin.collections.MutableIterator<E of java.util.ArrayList?> [operator] declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList<E of java.util.ArrayList>, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.collections.MutableList<kotlin.String?> [fake_override]
overridden:
public open fun subList (p0: kotlin.Int, p1: kotlin.Int): kotlin.collections.MutableList<E of java.util.ArrayList?> declared in java.util.ArrayList
$this: VALUE_PARAMETER name:<this> type:java.util.ArrayList<E of java.util.ArrayList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Int
VALUE_PARAMETER name:p1 index:1 type:kotlin.Int
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<E of java.util.AbstractList>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (p0: kotlin.Any?): kotlin.Boolean [operator] declared in java.util.AbstractList
$this: VALUE_PARAMETER name:<this> type:java.util.AbstractList<E of java.util.AbstractList>
VALUE_PARAMETER name:p0 index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<E of java.util.AbstractList>) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in java.util.AbstractList
$this: VALUE_PARAMETER name:<this> type:java.util.AbstractList<E of java.util.AbstractList>
FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<E of java.util.AbstractCollection>, p0:kotlin.collections.Collection<*>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun containsAll (p0: kotlin.collections.Collection<*>): kotlin.Boolean declared in java.util.AbstractCollection
$this: VALUE_PARAMETER name:<this> type:java.util.AbstractCollection<E of java.util.AbstractCollection>
VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<*>
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<E of java.util.AbstractCollection>) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in java.util.AbstractCollection
$this: VALUE_PARAMETER name:<this> type:java.util.AbstractCollection<E of java.util.AbstractCollection>
FUN FAKE_OVERRIDE name:removeAt visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList<E of kotlin.collections.MutableList>, index:kotlin.Int) returnType:kotlin.String? [fake_override]
overridden:
public abstract fun removeAt (index: kotlin.Int): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList
$this: VALUE_PARAMETER name:<this> type:kotlin.collections.MutableList<E of kotlin.collections.MutableList>
VALUE_PARAMETER name:index index:0 type:kotlin.Int
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
VAR name:a type:<root>.A [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
WHEN type=kotlin.Unit origin=IF
BRANCH
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'public final fun <get-size> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'val a: <root>.A [val] declared in <root>.box' type=<root>.A origin=null
arg1: CONST Int type=kotlin.Int value=56
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="fail: "
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: CALL 'public final fun <get-size> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'val a: <root>.A [val] declared in <root>.box' type=<root>.A origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="OK"

0 comments on commit aedfdc6

Please sign in to comment.