diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt index 6f8c11ab6e2..141652bd5e8 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt @@ -64,6 +64,7 @@ class KotlinLikeDumpOptions( // TODO support val labelPrintingStrategy: LabelPrintingStrategy = LabelPrintingStrategy.NEVER, val printFakeOverridesStrategy: FakeOverridesStrategy = FakeOverridesStrategy.ALL, + val bodyPrintingStrategy: BodyPrintingStrategy = BodyPrintingStrategy.PRINT_BODIES, val printElseAsTrue: Boolean = false, /* TODO add more options: @@ -91,6 +92,12 @@ enum class FakeOverridesStrategy { NONE } +enum class BodyPrintingStrategy { + NO_BODIES, + PRINT_ONLY_LOCAL_CLASSES_AND_FUNCTIONS, + PRINT_BODIES, +} + // TODO_ conventions: // TODO support -- for unsupported nodes // TODO no test -- for the cases with no test(s) @@ -118,29 +125,33 @@ enum class FakeOverridesStrategy { */ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOptions) : IrElementVisitor { - private val IrSymbol.safeName get() = if (!isBound) { - "/* ERROR: unbound symbol $signature */" - } else { - (owner as? IrDeclarationWithName)?.name?.toString() ?: "/* ERROR: unnamed symbol $signature */" - } + private val IrSymbol.safeName + get() = if (!isBound) { + "/* ERROR: unbound symbol $signature */" + } else { + (owner as? IrDeclarationWithName)?.name?.toString() ?: "/* ERROR: unnamed symbol $signature */" + } - private val IrFunctionSymbol.safeValueParameters get() = if (!isBound) { - emptyList() - } else { - owner.valueParameters - } + private val IrFunctionSymbol.safeValueParameters + get() = if (!isBound) { + emptyList() + } else { + owner.valueParameters + } - private val IrSymbol.safeParentClassName get() = if (!isBound) { - "/* ERROR: unbound symbol $signature */" - } else { - (owner as? IrDeclaration)?.parentClassOrNull?.name?.toString() ?: "/* ERROR: unexpected parent for $safeName */" - } + private val IrSymbol.safeParentClassName + get() = if (!isBound) { + "/* ERROR: unbound symbol $signature */" + } else { + (owner as? IrDeclaration)?.parentClassOrNull?.name?.toString() ?: "/* ERROR: unexpected parent for $safeName */" + } - private val IrSymbol.safeParentClassOrNull get() = if (!isBound) { - null - } else { - (owner as? IrDeclaration)?.parentClassOrNull - } + private val IrSymbol.safeParentClassOrNull + get() = if (!isBound) { + null + } else { + (owner as? IrDeclaration)?.parentClassOrNull + } fun printElement(element: IrElement) { @@ -510,8 +521,10 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printIndent() p.printWithNoIndent(declaration.name) declaration.initializerExpression?.let { - // it's not valid kotlin - p.printWithNoIndent(" = ") + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + // it's not valid kotlin + p.printWithNoIndent(" = ") + } it.accept(this, declaration) } p.println() @@ -528,7 +541,10 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption // TODO no tests, looks like there are no irText tests for isStatic flag p(declaration.isStatic, customModifier("static")) - p.printWithNoIndent("init ") + p.printWithNoIndent("init") + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" ") + } declaration.body.accept(this, declaration) p.printlnWithNoIndent() @@ -582,9 +598,15 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption declaration.printTypeParametersWithNoIndent() declaration.printValueParametersWithNoIndent() declaration.printWhereClauseIfNeededWithNoIndent() - p.printWithNoIndent(" ") - p(declaration.isPrimary, customModifier("primary")) - declaration.body?.accept(this, declaration) + if (declaration.isPrimary) { + p.printWithNoIndent(" ", customModifier("primary")) + } + declaration.body?.let { + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" ") + } + it.accept(this, declaration) + } p.printlnWithNoIndent() } @@ -654,10 +676,15 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption printWhereClauseIfNeededWithNoIndent() body?.let { - p.printWithNoIndent(" ") + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" ") + } it.accept(this@KotlinLikeDumper, null) } - } else { + + } + + if (!printSignatureAndBody || body == null || options.bodyPrintingStrategy != BodyPrintingStrategy.PRINT_BODIES) { p.printlnWithNoIndent() } } @@ -696,7 +723,9 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption // TODO print it.type too for varargs? defaultValue?.let { v -> - p.printWithNoIndent(" = ") + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" = ") + } v.accept(this@KotlinLikeDumper, data) } } @@ -781,7 +810,9 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption * provideDelegate */ - p(declaration.isDelegated, " " + commentBlock("by")) + if (declaration.isDelegated) { + p.printWithNoIndent(" ", commentBlock("by")) + } p.printlnWithNoIndent() p.pushIndent() @@ -789,9 +820,18 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption // TODO share code with visitField? // it's not valid kotlin declaration.backingField?.initializer?.let { - p.print("field = ") + if (options.bodyPrintingStrategy != BodyPrintingStrategy.NO_BODIES) { + // If the strategy is PRINT_ONLY_LOCAL_CLASSES_AND_FUNCTIONS, the local declarations in the backing field initializer + // will be printed under 'field'. + p.print("field") + } + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" = ") + } it.accept(this, declaration) - p.printlnWithNoIndent() + if (options.bodyPrintingStrategy != BodyPrintingStrategy.NO_BODIES) { + p.printlnWithNoIndent() + } } // TODO generate better name for set parameter ``? @@ -851,7 +891,9 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption declaration.type.printTypeWithNoIndent() declaration.initializer?.let { - p.printWithNoIndent(" = ") + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" = ") + } it.accept(this, declaration) } @@ -902,14 +944,49 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption type.printTypeWithNoIndent() } + private fun printBody(body: Body, data: IrDeclaration?, actuallyPrint: () -> Unit) { + when (options.bodyPrintingStrategy) { + BodyPrintingStrategy.NO_BODIES -> {} + BodyPrintingStrategy.PRINT_ONLY_LOCAL_CLASSES_AND_FUNCTIONS -> body.acceptChildren( + // Don't print bodies, but print local classes and functions declared in those bodies + object : IrElementVisitor { + override fun visitElement(element: IrElement, data: IrDeclaration?) { + element.acceptChildren(this, data) + } + + override fun visitDeclaration(declaration: IrDeclarationBase, data: IrDeclaration?) { + p.println() + p.pushIndent() + declaration.accept(this@KotlinLikeDumper, data) + p.popIndent() + } + + override fun visitVariable(declaration: IrVariable, data: IrDeclaration?) { + declaration.acceptChildren(this, data) + } + + override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: IrDeclaration?) { + declaration.acceptChildren(this, data) + } + }, + data + ) + BodyPrintingStrategy.PRINT_BODIES -> actuallyPrint() + } + } + override fun visitExpressionBody(body: IrExpressionBody, data: IrDeclaration?) { - // TODO should we print something here? - body.expression.accept(this, data) + printBody(body, data) { + // TODO should we print something here? + body.expression.accept(this, data) + } } override fun visitBlockBody(body: IrBlockBody, data: IrDeclaration?) { - body.printStatementContainer("{", "}", data) - p.printlnWithNoIndent() + printBody(body, data) { + body.printStatementContainer("{", "}", data) + p.printlnWithNoIndent() + } } override fun visitComposite(expression: IrComposite, data: IrDeclaration?) { @@ -950,8 +1027,10 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } override fun visitSyntheticBody(body: IrSyntheticBody, data: IrDeclaration?) { - // it's not valid kotlin - p.printlnWithNoIndent("/* Synthetic body for ${body.kind} */") + printBody(body, data) { + // it's not valid kotlin + p.printlnWithNoIndent("/* Synthetic body for ${body.kind} */") + } } override fun visitCall(expression: IrCall, data: IrDeclaration?) { diff --git a/compiler/testData/ir/irText/classes/abstractMembers.kt.txt b/compiler/testData/ir/irText/classes/abstractMembers.kt.txt index 7fd4ece2747..e2c7f1e9c57 100644 --- a/compiler/testData/ir/irText/classes/abstractMembers.kt.txt +++ b/compiler/testData/ir/irText/classes/abstractMembers.kt.txt @@ -6,6 +6,7 @@ abstract class AbstractClass { } abstract fun abstractFun() + abstract val abstractVal: Int abstract get @@ -17,6 +18,7 @@ abstract class AbstractClass { interface Interface { abstract fun abstractFun() + abstract val abstractVal: Int abstract get diff --git a/compiler/testData/ir/irText/classes/classMembers.kt.txt b/compiler/testData/ir/irText/classes/classMembers.kt.txt index 96d4d713458..61660f8492d 100644 --- a/compiler/testData/ir/irText/classes/classMembers.kt.txt +++ b/compiler/testData/ir/irText/classes/classMembers.kt.txt @@ -62,6 +62,7 @@ class C { interface NestedInterface { abstract fun foo() + fun bar() { return .foo() } diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt index e201e39c537..862c82da0ad 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt @@ -1,5 +1,6 @@ interface IBase { abstract fun foo(a: A, b: B) + abstract val C.id: Map? abstract get diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt index 5deaf7c5b52..877deaf4c88 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt.txt @@ -1,5 +1,6 @@ interface IBase { abstract fun foo(a: A, b: B) + abstract val C.id: Map? abstract get diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt index 0830ef5199f..481881c2433 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt @@ -1,6 +1,8 @@ interface IBase { abstract fun foo(x: Int, s: String) + abstract fun bar(): Int + abstract fun String.qux() } diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt index 5674ced870b..df5923eabab 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt @@ -1,6 +1,8 @@ interface IBase { abstract fun foo(x: Int, s: String) + abstract fun bar(): Int + abstract fun String.qux() } diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt index d9bab6c67f1..fe85467fb19 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt @@ -1,5 +1,6 @@ interface IFooBar { abstract fun foo() + abstract fun bar() } diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt index f5ab2ebfe2b..58b121838cd 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt.txt @@ -1,5 +1,6 @@ interface IFooBar { abstract fun foo() + abstract fun bar() } diff --git a/compiler/testData/ir/irText/classes/enum.fir.kt.txt b/compiler/testData/ir/irText/classes/enum.fir.kt.txt index f975e403152..fc20efc3530 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.kt.txt @@ -66,6 +66,7 @@ abstract enum class TestEnum3 : Enum { } abstract fun foo() + fun values(): Array /* Synthetic body for ENUM_VALUES */ fun valueOf(value: String): TestEnum3 /* Synthetic body for ENUM_VALUEOF */ @@ -122,6 +123,7 @@ abstract enum class TestEnum4 : Enum { } abstract fun foo() + fun values(): Array /* Synthetic body for ENUM_VALUES */ fun valueOf(value: String): TestEnum4 /* Synthetic body for ENUM_VALUEOF */ diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt index 8ccb08e6b8f..e06f8701907 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.kt.txt @@ -142,6 +142,7 @@ abstract enum class TestAbstractEnum1 : Enum { } abstract fun foo() + fun values(): Array /* Synthetic body for ENUM_VALUES */ fun valueOf(value: String): TestAbstractEnum1 /* Synthetic body for ENUM_VALUEOF */ diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt index 37a7b7dd8ac..6dfef1e32eb 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.kt.txt @@ -96,6 +96,7 @@ abstract enum class Test2 : Enum { } abstract fun foo() + fun values(): Array /* Synthetic body for ENUM_VALUES */ fun valueOf(value: String): Test2 /* Synthetic body for ENUM_VALUEOF */ diff --git a/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt b/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt index cf8b8b6e429..46a30848d50 100644 --- a/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt +++ b/compiler/testData/ir/irText/classes/superCallsComposed.kt.txt @@ -16,6 +16,7 @@ open class Base { interface BaseI { abstract fun foo() + abstract val bar: String abstract get diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt index 65a8050c479..030bae1898c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt @@ -14,6 +14,7 @@ interface IFoo { @Ann abstract fun testFun() + @Ann abstract val String.testExtVal: String abstract get diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt index 1845618e6ba..337fff72795 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt.txt @@ -14,6 +14,7 @@ interface IFoo { @Ann abstract fun testFun() + @Ann abstract val String.testExtVal: String abstract get diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt index c346b56d7d4..a4d7864e511 100644 --- a/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt.txt @@ -7,6 +7,7 @@ fun outer() { } abstract fun afun() + abstract val aval: Int abstract get diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.kt.txt index c377c786972..f2acd578282 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.kt.txt @@ -7,6 +7,7 @@ expect abstract class A { expect open class B : A { expect constructor(i: Int) /* primary */ expect override fun foo() + expect open fun bar(s: String) } diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt index 953d2af98ef..5298e6d7e41 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt @@ -1,5 +1,6 @@ interface IBase { abstract fun foo(x: Int) + abstract val bar: Int abstract get diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt index b330060d491..fa6cbe65972 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt.txt @@ -1,5 +1,6 @@ interface IBase { abstract fun foo(x: Int) + abstract val bar: Int abstract get diff --git a/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt b/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt index 8664c666e4a..7ae049ccf92 100644 --- a/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt +++ b/compiler/testData/ir/irText/expressions/interfaceThisRef.kt.txt @@ -1,5 +1,6 @@ interface IFoo { abstract fun foo() + fun bar() { .foo() } diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt index 17b686a9c7f..e58def6a82b 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt @@ -1,5 +1,6 @@ interface Visitor { abstract fun visit() + fun visitArray(): Visitor? { return null } diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt index 4e20960ab55..9f610c75666 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.kt.txt @@ -1,5 +1,6 @@ interface Visitor { abstract fun visit() + fun visitArray(): Visitor? { return null } diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt index 0b5f1c44679..61fa33bc1c2 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt @@ -9,7 +9,9 @@ sealed class ArrayMap : Iterable { abstract get abstract operator fun set(index: Int, value: T) + abstract operator fun get(index: Int): T? + abstract fun copy(): ArrayMap } diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt index 5c66f84b2a7..1654bacddeb 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.kt.txt @@ -9,7 +9,9 @@ sealed class ArrayMap : Iterable { abstract get abstract operator fun set(index: Int, value: T) + abstract operator fun get(index: Int): T? + abstract fun copy(): ArrayMap } diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt index 9552e8e916b..2ddd07fcf84 100644 --- a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.kt.txt @@ -4,7 +4,9 @@ interface IrType { interface TypeRemapper { abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) + abstract fun remapType(type: IrType): IrType + abstract fun leaveScope() } diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt index aeae3eb4bdd..5ac3eca9d52 100644 --- a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt.txt @@ -4,7 +4,9 @@ interface IrType { interface TypeRemapper { abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) + abstract fun remapType(type: IrType): IrType + abstract fun leaveScope() } diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt index 95c3a55ee57..b0ac1a5ef2d 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.fir.kt.txt @@ -13,6 +13,7 @@ abstract class Base { get abstract fun foo(y: Y): T + abstract var bar: T abstract get abstract set diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt index 95c3a55ee57..b0ac1a5ef2d 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt.txt @@ -13,6 +13,7 @@ abstract class Base { get abstract fun foo(y: Y): T + abstract var bar: T abstract get abstract set diff --git a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.fir.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.fir.kt.txt index 2e4d12b9033..4428e37d0aa 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.fir.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.fir.kt.txt @@ -1,5 +1,6 @@ interface B : A { abstract override fun foo(x: T1): T1 + abstract override fun bar(x: (T1 & Any)): (T1 & Any) } diff --git a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt index 2e4d12b9033..4428e37d0aa 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.kt.txt @@ -1,5 +1,6 @@ interface B : A { abstract override fun foo(x: T1): T1 + abstract override fun bar(x: (T1 & Any)): (T1 & Any) } diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt index 9235a390412..75bab680015 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.fir.kt.txt @@ -1,5 +1,6 @@ interface I { abstract fun input(t: T) + abstract fun output(): T } diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt index 454b3b8691a..610b54d619c 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt.txt @@ -1,5 +1,6 @@ interface I { abstract fun input(t: T) + abstract fun output(): T } diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt b/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt index 71bcaecd4ee..c4ed6c143c8 100644 --- a/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt +++ b/compiler/testData/ir/irText/types/genericFunWithStar.fir.kt.txt @@ -22,6 +22,7 @@ abstract class Box : IFoo, IBar where T : IFoo, T : IBar { } abstract fun foo(tSerializer: I): I> where F : IFoo, F : IBar + fun bar(vararg serializers: I<*>): I<*> { return .foo(tSerializer = serializers.get(index = 0)) } diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt b/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt index 5b55e04241f..1a5944fd2d7 100644 --- a/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt +++ b/compiler/testData/ir/irText/types/genericFunWithStar.kt.txt @@ -22,6 +22,7 @@ abstract class Box : IFoo, IBar where T : IFoo, T : IBar { } abstract fun foo(tSerializer: I): I> where F : IFoo, F : IBar + fun bar(vararg serializers: I<*>): I<*> { return .foo(tSerializer = serializers.get(index = 0)) } diff --git a/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt b/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt index a828aeb7ff6..6f998a71dba 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt @@ -1,7 +1,10 @@ interface K { abstract fun kf1(): Collection + abstract fun kf2(): Collection + abstract fun kg1(c: Collection) + abstract fun kg2(c: Collection) } diff --git a/compiler/testData/ir/irText/types/javaWildcardType.kt.txt b/compiler/testData/ir/irText/types/javaWildcardType.kt.txt index 6f19f315bf8..ddc6cfa87a0 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.kt.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.kt.txt @@ -1,7 +1,10 @@ interface K { abstract fun kf1(): Collection + abstract fun kf2(): Collection + abstract fun kg1(c: Collection) + abstract fun kg2(c: Collection) }