diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt index e6e1804cc02..152637971c9 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt @@ -28,7 +28,6 @@ import org.jetbrains.kotlin.fir.scopes.impl.lazyNestedClassifierScope import org.jetbrains.kotlin.fir.scopes.impl.nestedClassifierScope import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.impl.* -import org.jetbrains.kotlin.fir.types.ConeNullability import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.toFirSourceElement import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl @@ -77,23 +76,33 @@ class JavaSymbolProvider( } } - private fun JavaTypeParameter.toFirTypeParameter(javaTypeParameterStack: JavaTypeParameterStack): FirTypeParameterBuilder { - javaTypeParameterStack.getBuilder(this)?.let { return it } + private fun JavaTypeParameter.toFirTypeParameterSymbol( + javaTypeParameterStack: JavaTypeParameterStack + ): Pair { + val stored = javaTypeParameterStack.safeGet(this) + if (stored != null) return stored to true val firSymbol = FirTypeParameterSymbol() + javaTypeParameterStack.add(this, firSymbol) + return firSymbol to false + } + + private fun JavaTypeParameter.toFirTypeParameter( + firSymbol: FirTypeParameterSymbol, + javaTypeParameterStack: JavaTypeParameterStack + ): FirTypeParameter { return FirTypeParameterBuilder().apply { - session = this@JavaSymbolProvider.session - name = this@toFirTypeParameter.name + this.session = this@JavaSymbolProvider.session + this.name = this@toFirTypeParameter.name symbol = firSymbol variance = INVARIANT isReified = false - }.also { - javaTypeParameterStack.add(this, it) - } + addBounds(this@toFirTypeParameter, javaTypeParameterStack) + }.build() } private fun FirTypeParameterBuilder.addBounds( javaTypeParameter: JavaTypeParameter, - stack: JavaTypeParameterStack, + stack: JavaTypeParameterStack ) { for (upperBound in javaTypeParameter.upperBounds) { bounds += upperBound.toFirResolvedTypeRef( @@ -107,14 +116,12 @@ class JavaSymbolProvider( } private fun List.convertTypeParameters(stack: JavaTypeParameterStack): List { - return this - .map { it.toFirTypeParameter(stack) } - .mapIndexed { index, typeParameterBuilder -> - if (typeParameterBuilder.bounds.isEmpty()) { - typeParameterBuilder.addBounds(this[index], stack) - } - typeParameterBuilder.build() - } + return map { it.toFirTypeParameterSymbol(stack) }.mapIndexed { index, (symbol, initialized) -> + // This nasty logic is required, because type parameter bound can refer other type parameter from the list + // So we have to create symbols first, and type parameters themselves after them + if (initialized) symbol.fir + else this[index].toFirTypeParameter(symbol, stack) + } } override fun getClassLikeSymbolByFqName(classId: ClassId): FirRegularClassSymbol? { diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaTypeParameterStack.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaTypeParameterStack.kt index d70b843f5ea..eaccd51180c 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaTypeParameterStack.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaTypeParameterStack.kt @@ -5,16 +5,15 @@ package org.jetbrains.kotlin.fir.java -import org.jetbrains.kotlin.fir.declarations.builder.FirTypeParameterBuilder import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol import org.jetbrains.kotlin.load.java.structure.JavaTypeParameter internal class JavaTypeParameterStack { - private val typeParameterMap = mutableMapOf() + private val typeParameterMap = mutableMapOf() - fun add(javaTypeParameter: JavaTypeParameter, firTypeParameterBuilder: FirTypeParameterBuilder) { - typeParameterMap[javaTypeParameter] = firTypeParameterBuilder + fun add(javaTypeParameter: JavaTypeParameter, symbol: FirTypeParameterSymbol) { + typeParameterMap[javaTypeParameter] = symbol } fun addStack(javaTypeParameterStack: JavaTypeParameterStack) { @@ -30,9 +29,7 @@ internal class JavaTypeParameterStack { ?: throw IllegalArgumentException("Cannot find Java type parameter $javaTypeParameter in stack") } - fun safeGet(javaTypeParameter: JavaTypeParameter) = typeParameterMap[javaTypeParameter]?.symbol - - fun getBuilder(javaTypeParameter: JavaTypeParameter) = typeParameterMap[javaTypeParameter] + fun safeGet(javaTypeParameter: JavaTypeParameter) = typeParameterMap[javaTypeParameter] companion object { val EMPTY: JavaTypeParameterStack = JavaTypeParameterStack() diff --git a/compiler/testData/codegen/box/arrays/collectionGetMultiIndex.kt b/compiler/testData/codegen/box/arrays/collectionGetMultiIndex.kt index f94e00f8cce..4cc8a004134 100644 --- a/compiler/testData/codegen/box/arrays/collectionGetMultiIndex.kt +++ b/compiler/testData/codegen/box/arrays/collectionGetMultiIndex.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME operator fun ArrayList.get(index1: Int, index2: Int) = this[index1 + index2] operator fun ArrayList.set(index1: Int, index2: Int, elem: String) { diff --git a/compiler/testData/codegen/box/arrays/hashMap.kt b/compiler/testData/codegen/box/arrays/hashMap.kt index 9a5ac9edad2..38316baee5e 100644 --- a/compiler/testData/codegen/box/arrays/hashMap.kt +++ b/compiler/testData/codegen/box/arrays/hashMap.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME operator fun HashMap.set(index: String, elem: Int?) { this.put(index, elem) diff --git a/compiler/testData/codegen/box/arrays/kt950.kt b/compiler/testData/codegen/box/arrays/kt950.kt index dffeadc22d7..ca832fd2ad9 100644 --- a/compiler/testData/codegen/box/arrays/kt950.kt +++ b/compiler/testData/codegen/box/arrays/kt950.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME operator fun MutableMap.set(k : K, v : V) = put(k, v) diff --git a/compiler/testData/codegen/box/bridges/fakeOverrideThroughGenericSuperclass.kt b/compiler/testData/codegen/box/bridges/fakeOverrideThroughGenericSuperclass.kt index d7ded261858..19131a86de2 100644 --- a/compiler/testData/codegen/box/bridges/fakeOverrideThroughGenericSuperclass.kt +++ b/compiler/testData/codegen/box/bridges/fakeOverrideThroughGenericSuperclass.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR var result = "Fail" diff --git a/compiler/testData/codegen/box/classes/kt2395.kt b/compiler/testData/codegen/box/classes/kt2395.kt index bdbd1b7673c..ccd1b1c5356 100644 --- a/compiler/testData/codegen/box/classes/kt2395.kt +++ b/compiler/testData/codegen/box/classes/kt2395.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM import java.util.AbstractList diff --git a/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt b/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt index dbb31b011f0..f1751827e0c 100644 --- a/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt +++ b/compiler/testData/codegen/box/classes/overloadUnaryOperator.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME class ArrayWrapper() { diff --git a/compiler/testData/codegen/box/hashPMap/manyNumbers.kt b/compiler/testData/codegen/box/hashPMap/manyNumbers.kt index e9f6ed75dae..71146219ca5 100644 --- a/compiler/testData/codegen/box/hashPMap/manyNumbers.kt +++ b/compiler/testData/codegen/box/hashPMap/manyNumbers.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/hashPMap/rewriteWithDifferent.kt b/compiler/testData/codegen/box/hashPMap/rewriteWithDifferent.kt index fdedb6b6956..26b01a8a3c0 100644 --- a/compiler/testData/codegen/box/hashPMap/rewriteWithDifferent.kt +++ b/compiler/testData/codegen/box/hashPMap/rewriteWithDifferent.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/hashPMap/rewriteWithEqual.kt b/compiler/testData/codegen/box/hashPMap/rewriteWithEqual.kt index 04a03e5aca6..0e3bcf42734 100644 --- a/compiler/testData/codegen/box/hashPMap/rewriteWithEqual.kt +++ b/compiler/testData/codegen/box/hashPMap/rewriteWithEqual.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/hashPMap/simplePlusGet.kt b/compiler/testData/codegen/box/hashPMap/simplePlusGet.kt index 283d4411e76..6c3c67f00b5 100644 --- a/compiler/testData/codegen/box/hashPMap/simplePlusGet.kt +++ b/compiler/testData/codegen/box/hashPMap/simplePlusGet.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/hashPMap/simplePlusMinus.kt b/compiler/testData/codegen/box/hashPMap/simplePlusMinus.kt index c0df2c3ac73..912934e1b0f 100644 --- a/compiler/testData/codegen/box/hashPMap/simplePlusMinus.kt +++ b/compiler/testData/codegen/box/hashPMap/simplePlusMinus.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/increment/mutableListElement.kt b/compiler/testData/codegen/box/increment/mutableListElement.kt index d4fdd137464..4a719eaaef5 100644 --- a/compiler/testData/codegen/box/increment/mutableListElement.kt +++ b/compiler/testData/codegen/box/increment/mutableListElement.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/platformTypes/primitives/assign.kt b/compiler/testData/codegen/box/platformTypes/primitives/assign.kt index 65c5a9f98d9..ef09ad12eb1 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/assign.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/assign.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/dec.kt b/compiler/testData/codegen/box/platformTypes/primitives/dec.kt index 27c7a05d71e..a533970cf43 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/dec.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/dec.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/div.kt b/compiler/testData/codegen/box/platformTypes/primitives/div.kt index 10c105706db..4944dab921c 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/div.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/div.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/equals.kt b/compiler/testData/codegen/box/platformTypes/primitives/equals.kt index 82e0cec4209..4a70a0e006d 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/equals.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/equals.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/hashCode.kt b/compiler/testData/codegen/box/platformTypes/primitives/hashCode.kt index 4956bc8d74d..a0f3ed169cb 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/hashCode.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/hashCode.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/identityEquals.kt b/compiler/testData/codegen/box/platformTypes/primitives/identityEquals.kt index f143aa65bfb..1b91be8d2d8 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/identityEquals.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/identityEquals.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM fun box(): String { diff --git a/compiler/testData/codegen/box/platformTypes/primitives/inc.kt b/compiler/testData/codegen/box/platformTypes/primitives/inc.kt index b890b3ebac6..d57a93944e9 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/inc.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/inc.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/minus.kt b/compiler/testData/codegen/box/platformTypes/primitives/minus.kt index 621b8764817..bd6fabdf999 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/minus.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/minus.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/mod.kt b/compiler/testData/codegen/box/platformTypes/primitives/mod.kt index 5449a258074..3a4f75e2378 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/mod.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/mod.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/not.kt b/compiler/testData/codegen/box/platformTypes/primitives/not.kt index 042f15ea9d1..d274e58e416 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/not.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/not.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/notEquals.kt b/compiler/testData/codegen/box/platformTypes/primitives/notEquals.kt index 3c8984ebb6f..1ef723c005e 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/notEquals.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/notEquals.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/plus.kt b/compiler/testData/codegen/box/platformTypes/primitives/plus.kt index 7f2878c5a6c..a346703f3f8 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/plus.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/plus.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/rangeTo.kt b/compiler/testData/codegen/box/platformTypes/primitives/rangeTo.kt index e14c0f45f9d..865e6d5de32 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/rangeTo.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/rangeTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/times.kt b/compiler/testData/codegen/box/platformTypes/primitives/times.kt index bb555863b7b..91d6bd4220f 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/times.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/times.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/toShort.kt b/compiler/testData/codegen/box/platformTypes/primitives/toShort.kt index b0629135391..319627270d1 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/toShort.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/toShort.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/toString.kt b/compiler/testData/codegen/box/platformTypes/primitives/toString.kt index 755917214e4..cbda7d28c5f 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/toString.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/toString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/unaryMinus.kt b/compiler/testData/codegen/box/platformTypes/primitives/unaryMinus.kt index 7ad24dc474c..fe36a4dd17e 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/unaryMinus.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/unaryMinus.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/platformTypes/primitives/unaryPlus.kt b/compiler/testData/codegen/box/platformTypes/primitives/unaryPlus.kt index 6c201a3c490..02a53edb862 100644 --- a/compiler/testData/codegen/box/platformTypes/primitives/unaryPlus.kt +++ b/compiler/testData/codegen/box/platformTypes/primitives/unaryPlus.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val l = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/forInIndices/forInArrayListIndices.kt b/compiler/testData/codegen/box/ranges/forInIndices/forInArrayListIndices.kt index 02987666bda..2a90ff45b41 100644 --- a/compiler/testData/codegen/box/ranges/forInIndices/forInArrayListIndices.kt +++ b/compiler/testData/codegen/box/ranges/forInIndices/forInArrayListIndices.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/multiAssignmentIterationOverIntRange.kt b/compiler/testData/codegen/box/ranges/multiAssignmentIterationOverIntRange.kt index b2f51118747..7d76e00ffec 100644 --- a/compiler/testData/codegen/box/ranges/multiAssignmentIterationOverIntRange.kt +++ b/compiler/testData/codegen/box/ranges/multiAssignmentIterationOverIntRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt index 4eb93931cff..2456eb416d5 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt @@ -2,21 +2,21 @@ FILE fqName: fileName:/genericSamProjectedOut.kt FUN name:test visibility:public modality:FINAL <> (a:example.SomeJavaClass) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:example.SomeJavaClass BLOCK_BODY - CALL 'public open fun someFunction (hello: example.Hello?): kotlin.Unit declared in example.SomeJavaClass' type=kotlin.Unit origin=null + CALL 'public open fun someFunction (hello: example.Hello?): kotlin.Unit declared in example.SomeJavaClass' type=kotlin.Unit origin=null $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null hello: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String?) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.String? BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public open fun plus (hello: example.Hello?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null + CALL 'public open fun plus (hello: example.Hello?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null hello: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String?) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.String? BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public open fun get (hello: example.Hello?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null + CALL 'public open fun get (hello: example.Hello?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null hello: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String?) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt index 677a0c7b43e..ca631aa280b 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt @@ -3,7 +3,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt VALUE_PARAMETER name:f index:0 type:kotlin.Function1 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function1): .C declared in ' - CONSTRUCTOR_CALL 'public constructor (jxx: .J?, X of ?>?) declared in .C' type=.C origin=null + CONSTRUCTOR_CALL 'public constructor (jxx: .J.C?, X of .C?>?) declared in .C' type=.C origin=null : kotlin.String? jxx: GET_VAR 'f: kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit @@ -11,7 +11,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt BLOCK_BODY TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null - CONSTRUCTOR_CALL 'public constructor (jxx: .J?, X of ?>?) declared in .C' type=.C origin=null + CONSTRUCTOR_CALL 'public constructor (jxx: .J.C?, X of .C?>?) declared in .C' type=.C origin=null : kotlin.String? jxx: TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index d24487e7d94..52f9cb333a0 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -18,7 +18,7 @@ FILE fqName: fileName:/builtinMap.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun apply (block: kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null : java.util.LinkedHashMap.plus?, V1 of .plus?> - $receiver: CONSTRUCTOR_CALL 'public constructor (p0: kotlin.collections.Map?, out V of ?>?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null + $receiver: CONSTRUCTOR_CALL 'public constructor (p0: kotlin.collections.Map?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null : K1 of .plus? : V1 of .plus? p0: GET_VAR ': kotlin.collections.Map.plus, V1 of .plus> declared in .plus' type=kotlin.collections.Map.plus, V1 of .plus> origin=null @@ -27,9 +27,9 @@ FILE fqName: fileName:/builtinMap.kt $receiver: VALUE_PARAMETER name: type:java.util.LinkedHashMap.plus?, V1 of .plus?> BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .plus' - CALL 'public open fun put (p0: K1 of .plus?, p1: V1 of .plus?): V1 of .plus? declared in java.util.LinkedHashMap' type=V1 of .plus? origin=null + CALL 'public open fun put (p0: K of java.util.LinkedHashMap?, p1: V of java.util.LinkedHashMap?): V of java.util.LinkedHashMap? declared in java.util.LinkedHashMap' type=V1 of .plus? origin=null $this: GET_VAR ': java.util.LinkedHashMap.plus?, V1 of .plus?> declared in special.' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null - p0: CALL 'public final fun (): K1 of .plus declared in kotlin.Pair' type=K1 of .plus origin=GET_PROPERTY + p0: CALL 'public final fun (): A of kotlin.Pair declared in kotlin.Pair' type=K1 of .plus origin=GET_PROPERTY $this: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null - p1: CALL 'public final fun (): V1 of .plus declared in kotlin.Pair' type=V1 of .plus origin=GET_PROPERTY + p1: CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=V1 of .plus origin=GET_PROPERTY $this: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null