diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt index 8919f063fd8..d1e1f4224f9 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt @@ -396,7 +396,7 @@ fun unwrapCallableDescriptorAndTypeArguments(resolvedCall: ResolvedCall<*>): Cal null else unsubstitutedUnwrappedTypeParameters.associate { - val originalTypeParameter = originalDescriptor.typeParameters[it.index] + val originalTypeParameter = originalDescriptor.original.typeParameters[it.index] val originalTypeArgument = originalTypeArguments[originalTypeParameter] ?: throw AssertionError("No type argument for $originalTypeParameter") it to originalTypeArgument diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.kt b/compiler/testData/ir/irText/expressions/funImportedFromObject.kt new file mode 100644 index 00000000000..8da3cd52f7f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.kt @@ -0,0 +1,11 @@ +package test + +import test.Host.foo + +object Host { + inline fun foo(): String { + return "OK" + } +} + +fun test() = foo() diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.txt b/compiler/testData/ir/irText/expressions/funImportedFromObject.txt new file mode 100644 index 00000000000..be5bbd45eee --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.txt @@ -0,0 +1,36 @@ +FILE fqName:test fileName:/funImportedFromObject.kt + CLASS OBJECT name:Host modality:FINAL visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Host flags: + superClasses: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + CONSTRUCTOR visibility:private <> () returnType:test.Host flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' + INSTANCE_INITIALIZER_CALL classDescriptor='Host' + FUN name:foo visibility:public modality:FINAL ($this:test.Host) returnType:String flags:inline + TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER name: type:test.Host flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='foo(): String' + CONST String type=kotlin.String value=OK + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN name:test visibility:public modality:FINAL <> () returnType:String flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='test(): String' + CALL 'foo(): String' type=kotlin.String origin=null + : Any + $this: GET_OBJECT 'Host' type=test.Host diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.kt b/compiler/testData/ir/irText/expressions/useImportedMember.kt new file mode 100644 index 00000000000..83b806eb024 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/useImportedMember.kt @@ -0,0 +1,50 @@ +import C.f +import C.p +import C.ext +import C.g1 +import C.g2 +import C.fromClass +import C.fromInterface +import C.genericFromSuper + +interface I { + fun T.fromInterface(): T = this + + fun genericFromSuper(g: G) = g +} + +open class BaseClass { + val T.fromClass: T + get() = this +} + +object C: BaseClass(), I { + fun f(s: Int) = 1 + fun f(s: String) = 2 + fun Boolean.f() = 3 + + var p: Int = 4 + val Int.ext: Int + get() = 6 + + fun g1(t: T): T = t + val T.g2: T + get() = this +} + +fun box(): String { + if (f(1) != 1) return "1" + if (f("s") != 2) return "2" + if (true.f() != 3) return "3" + if (p != 4) return "4" + p = 5 + if (p != 5) return "5" + if (5.ext != 6) return "6" + if (g1("7") != "7") return "7" + if ("8".g2 != "8") return "8" + if (9.fromInterface() != 9) return "9" + if ("10".fromClass != "10") return "10" + if (genericFromSuper("11") != "11") return "11" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.txt b/compiler/testData/ir/irText/expressions/useImportedMember.txt new file mode 100644 index 00000000000..26cf2926d2e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/useImportedMember.txt @@ -0,0 +1,289 @@ +FILE fqName: fileName:/useImportedMember.kt + CLASS INTERFACE name:I modality:ABSTRACT visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:I flags: + superClasses: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + TYPE_PARAMETER name:G index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + FUN name:fromInterface visibility:public modality:OPEN ($this:I, $receiver:T) returnType:T flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER name: type:I flags: + $receiver: VALUE_PARAMETER name: type:T flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='fromInterface() on T: T' + GET_VAR 'this@fromInterface: T' type=T origin=null + FUN name:genericFromSuper visibility:public modality:OPEN <> ($this:I, g:G) returnType:G flags: + $this: VALUE_PARAMETER name: type:I flags: + VALUE_PARAMETER name:g index:0 type:G flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='genericFromSuper(G): G' + GET_VAR 'value-parameter g: G' type=G origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + CLASS CLASS name:BaseClass modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:BaseClass flags: + superClasses: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + CONSTRUCTOR visibility:public <> () returnType:BaseClass flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' + INSTANCE_INITIALIZER_CALL classDescriptor='BaseClass' + PROPERTY name:fromClass type:T visibility:public modality:FINAL flags:val + FUN name: visibility:public modality:FINAL ($this:BaseClass, $receiver:T) returnType:T flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER name: type:BaseClass flags: + $receiver: VALUE_PARAMETER name: type:T flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='() on T: T' + GET_VAR 'this@fromClass: T' type=T origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + CLASS OBJECT name:C modality:FINAL visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:C flags: + superClasses: + CLASS CLASS name:BaseClass modality:OPEN visibility:public flags: + CLASS INTERFACE name:I modality:ABSTRACT visibility:public flags: + CONSTRUCTOR visibility:private <> () returnType:C flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor BaseClass()' + INSTANCE_INITIALIZER_CALL classDescriptor='C' + FUN name:f visibility:public modality:FINAL <> ($this:C, s:kotlin.Int) returnType:Int flags: + $this: VALUE_PARAMETER name: type:C flags: + VALUE_PARAMETER name:s index:0 type:kotlin.Int flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='f(Int): Int' + CONST Int type=kotlin.Int value=1 + FUN name:f visibility:public modality:FINAL <> ($this:C, s:kotlin.String) returnType:Int flags: + $this: VALUE_PARAMETER name: type:C flags: + VALUE_PARAMETER name:s index:0 type:kotlin.String flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='f(String): Int' + CONST Int type=kotlin.Int value=2 + FUN name:f visibility:public modality:FINAL <> ($this:C, $receiver:kotlin.Boolean) returnType:Int flags: + $this: VALUE_PARAMETER name: type:C flags: + $receiver: VALUE_PARAMETER name: type:kotlin.Boolean flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='f() on Boolean: Int' + CONST Int type=kotlin.Int value=3 + PROPERTY name:p type:kotlin.Int visibility:public modality:FINAL flags:var + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=4 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:C) returnType:Int flags: + $this: VALUE_PARAMETER name: type:C flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='(): Int' + GET_FIELD 'p: Int' type=kotlin.Int origin=null + receiver: GET_VAR 'this@C: C' type=C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:C, :kotlin.Int) returnType:Unit flags: + $this: VALUE_PARAMETER name: type:C flags: + VALUE_PARAMETER name: index:0 type:kotlin.Int flags: + BLOCK_BODY + SET_FIELD 'p: Int' type=kotlin.Unit origin=null + receiver: GET_VAR 'this@C: C' type=C origin=null + value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null + PROPERTY name:ext type:kotlin.Int visibility:public modality:FINAL flags:val + FUN name: visibility:public modality:FINAL <> ($this:C, $receiver:kotlin.Int) returnType:Int flags: + $this: VALUE_PARAMETER name: type:C flags: + $receiver: VALUE_PARAMETER name: type:kotlin.Int flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='() on Int: Int' + CONST Int type=kotlin.Int value=6 + FUN name:g1 visibility:public modality:FINAL ($this:C, t:T) returnType:T flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER name: type:C flags: + VALUE_PARAMETER name:t index:0 type:T flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='g1(T): T' + GET_VAR 'value-parameter t: T' type=T origin=null + PROPERTY name:g2 type:T visibility:public modality:FINAL flags:val + FUN name: visibility:public modality:FINAL ($this:C, $receiver:T) returnType:T flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER name: type:C flags: + $receiver: VALUE_PARAMETER name: type:T flags: + BLOCK_BODY + RETURN type=kotlin.Nothing from='() on T: T' + GET_VAR 'this@g2: T' type=T origin=null + PROPERTY FAKE_OVERRIDE name:fromClass type:T visibility:public modality:FINAL flags:val + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:BaseClass, $receiver:T) returnType:T flags: + overridden: + FUN name: visibility:public modality:FINAL ($this:BaseClass, $receiver:T) returnType:T flags: + $this: VALUE_PARAMETER name: type:BaseClass flags: + $receiver: VALUE_PARAMETER name: type:T flags: + FUN FAKE_OVERRIDE name:fromInterface visibility:public modality:OPEN ($this:I, $receiver:T) returnType:T flags: + overridden: + FUN name:fromInterface visibility:public modality:OPEN ($this:I, $receiver:T) returnType:T flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?] + superClassifiers: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + $this: VALUE_PARAMETER name: type:I flags: + $receiver: VALUE_PARAMETER name: type:T flags: + FUN FAKE_OVERRIDE name:genericFromSuper visibility:public modality:OPEN <> ($this:I, g:kotlin.String) returnType:String flags: + overridden: + FUN name:genericFromSuper visibility:public modality:OPEN <> ($this:I, g:G) returnType:G flags: + $this: VALUE_PARAMETER name: type:I flags: + VALUE_PARAMETER name:g index:0 type:kotlin.String flags: + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN name:box visibility:public modality:FINAL <> () returnType:String flags: + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'f(Int): Int' type=kotlin.Int origin=null + $this: GET_OBJECT 'C' type=C + s: CONST Int type=kotlin.Int value=1 + arg1: CONST Int type=kotlin.Int value=1 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=1 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'f(String): Int' type=kotlin.Int origin=null + $this: GET_OBJECT 'C' type=C + s: CONST String type=kotlin.String value=s + arg1: CONST Int type=kotlin.Int value=2 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=2 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'f() on Boolean: Int' type=kotlin.Int origin=null + $this: GET_OBJECT 'C' type=C + $receiver: CONST Boolean type=kotlin.Boolean value=true + arg1: CONST Int type=kotlin.Int value=3 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=3 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'C' type=C + arg1: CONST Int type=kotlin.Int value=4 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=4 + CALL '(Int): Unit' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'C' type=C + : CONST Int type=kotlin.Int value=5 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'C' type=C + arg1: CONST Int type=kotlin.Int value=5 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=5 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '() on Int: Int' type=kotlin.Int origin=GET_PROPERTY + $this: GET_OBJECT 'C' type=C + $receiver: CONST Int type=kotlin.Int value=5 + arg1: CONST Int type=kotlin.Int value=6 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=6 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'g1(String): String' type=kotlin.String origin=null + : String + $this: GET_OBJECT 'C' type=C + t: CONST String type=kotlin.String value=7 + arg1: CONST String type=kotlin.String value=7 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=7 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '() on String: String' type=kotlin.String origin=GET_PROPERTY + $this: GET_OBJECT 'C' type=C + $receiver: CONST String type=kotlin.String value=8 + arg1: CONST String type=kotlin.String value=8 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=8 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'fromInterface() on Int: Int' type=kotlin.Int origin=null + : Int + $this: GET_OBJECT 'C' type=C + $receiver: CONST Int type=kotlin.Int value=9 + arg1: CONST Int type=kotlin.Int value=9 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=9 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL '() on String: String' type=kotlin.String origin=GET_PROPERTY + $this: GET_OBJECT 'C' type=C + $receiver: CONST String type=kotlin.String value=10 + arg1: CONST String type=kotlin.String value=10 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=10 + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'genericFromSuper(String): String' type=kotlin.String origin=null + $this: GET_OBJECT 'C' type=C + g: CONST String type=kotlin.String value=11 + arg1: CONST String type=kotlin.String value=11 + then: RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=11 + RETURN type=kotlin.Nothing from='box(): String' + CONST String type=kotlin.String value=OK diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 2d11f56b072..ad7d1b7f891 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -759,6 +759,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { doTest(fileName); } + @TestMetadata("funImportedFromObject.kt") + public void testFunImportedFromObject() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/funImportedFromObject.kt"); + doTest(fileName); + } + @TestMetadata("genericPropertyCall.kt") public void testGenericPropertyCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/genericPropertyCall.kt"); @@ -1023,6 +1029,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { doTest(fileName); } + @TestMetadata("useImportedMember.kt") + public void testUseImportedMember() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/useImportedMember.kt"); + doTest(fileName); + } + @TestMetadata("values.kt") public void testValues() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/values.kt");