IR text tests: Stable blank lines between declarations in class

Rework rendering of kt-like dump and signatures dump in order to avoid
unstable blank line between declarations of the same level:
1. No blank line for the first declaration inside the member scope of
the class.
2. Always a single blank line between each two subsequent declarations
inside the member scope of the class.
This commit is contained in:
Dmitriy Dolovov
2023-11-23 23:00:58 +01:00
committed by Space Team
parent 4532f52898
commit 16d1e85932
231 changed files with 236 additions and 280 deletions
@@ -24,7 +24,6 @@ class AnnotationLoader {
// Mangled name: Visitor
// Public signature: /Visitor|null[0]
interface Visitor {
// CHECK:
// Mangled name: Visitor#visit(){}
// Public signature: /Visitor.visit|-7531698844362190050[0]
@@ -1,5 +1,4 @@
interface NestedGroupFragment {
}
private fun addMavenOptionsGroupFragment(): <no name provided><Int> {
@@ -2,7 +2,6 @@
// Mangled name: NestedGroupFragment
// Public signature: /NestedGroupFragment|null[0]
interface NestedGroupFragment {
}
// CHECK JVM_IR:
@@ -144,6 +144,7 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
// Public signature: /ArrayMapImpl.Entry.<init>|437318787564761214[0]
// Public signature debug description: <init>(kotlin.Int;1:0){}
constructor(key: Int, value: T) /* primary */
// CHECK JVM_IR:
// Mangled name: ArrayMapImpl.Entry#component1(){}kotlin.Int
// Public signature: /ArrayMapImpl.Entry.component1|-8217597213800111288[0]
@@ -253,6 +254,7 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
// Public signature: /ArrayMapImpl.<init>|-940489726603364367[0]
// Public signature debug description: <init>(kotlin.Array<kotlin.Any?>){}
private constructor(data: Array<Any?>) /* primary */
// CHECK:
// Mangled name: ArrayMapImpl#<init>(){}
// Public signature: /ArrayMapImpl.<init>|-5645683436151566731[0]
@@ -1,13 +1,10 @@
interface ComponentContainer {
}
interface PlatformSpecificExtension<S : PlatformSpecificExtension<S>> {
}
interface ComponentDescriptor {
}
abstract class PlatformExtensionsClashResolver<E : PlatformSpecificExtension<E>> {
@@ -1,13 +1,10 @@
interface ComponentContainer {
}
interface PlatformSpecificExtension<S : PlatformSpecificExtension<S>> {
}
interface ComponentDescriptor {
}
abstract class PlatformExtensionsClashResolver<E : PlatformSpecificExtension<E>> {
@@ -68,21 +68,18 @@ abstract class PlatformExtensionsClashResolver<E : PlatformSpecificExtension<E>>
// Mangled name: ComponentContainer
// Public signature: /ComponentContainer|null[0]
interface ComponentContainer {
}
// CHECK:
// Mangled name: ComponentDescriptor
// Public signature: /ComponentDescriptor|null[0]
interface ComponentDescriptor {
}
// CHECK:
// Mangled name: PlatformSpecificExtension
// Public signature: /PlatformSpecificExtension|null[0]
interface PlatformSpecificExtension<S : PlatformSpecificExtension<S>> {
}
// CHECK:
@@ -1,5 +1,4 @@
interface IrType {
}
interface TypeRemapper {
@@ -19,7 +18,6 @@ interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent {
}
interface IrDeclaration {
}
interface IrTypeParameter : IrDeclaration {
@@ -29,7 +27,6 @@ interface IrTypeParameter : IrDeclaration {
}
interface IrDeclarationParent {
}
class DeepCopyIrTreeWithSymbols {
@@ -1,5 +1,4 @@
interface IrType {
}
interface TypeRemapper {
@@ -19,7 +18,6 @@ interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent {
}
interface IrDeclaration {
}
interface IrTypeParameter : IrDeclaration {
@@ -29,7 +27,6 @@ interface IrTypeParameter : IrDeclaration {
}
interface IrDeclarationParent {
}
class DeepCopyIrTreeWithSymbols {
@@ -45,28 +45,24 @@ class DeepCopyIrTreeWithSymbols {
// Mangled name: IrDeclaration
// Public signature: /IrDeclaration|null[0]
interface IrDeclaration {
}
// CHECK:
// Mangled name: IrDeclarationParent
// Public signature: /IrDeclarationParent|null[0]
interface IrDeclarationParent {
}
// CHECK:
// Mangled name: IrType
// Public signature: /IrType|null[0]
interface IrType {
}
// CHECK:
// Mangled name: IrTypeParameter
// Public signature: /IrTypeParameter|null[0]
interface IrTypeParameter : IrDeclaration {
// CHECK:
// Mangled name: IrTypeParameter{}superTypes
// Public signature: /IrTypeParameter.superTypes|4746750561425700979[0]
@@ -88,7 +84,6 @@ interface IrTypeParameter : IrDeclaration {
// Mangled name: IrTypeParametersContainer
// Public signature: /IrTypeParametersContainer|null[0]
interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent {
// CHECK:
// Mangled name: IrTypeParametersContainer{}typeParameters
// Public signature: /IrTypeParametersContainer.typeParameters|551746886075737521[0]
@@ -115,7 +110,6 @@ interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent {
// Mangled name: TypeRemapper
// Public signature: /TypeRemapper|null[0]
interface TypeRemapper {
// CHECK:
// Mangled name: TypeRemapper#enterScope(IrTypeParametersContainer){}
// Public signature: /TypeRemapper.enterScope|1651098445614641728[0]
@@ -7,6 +7,7 @@ class Impl : A, B {
// Public signature: /Impl.<init>|1084968671839233134[0]
// Public signature debug description: <init>(Foo.B){}
constructor(b: B) /* primary */
// CHECK JVM_IR:
// Mangled name: Impl#add(kotlin.String?){}kotlin.Boolean
// Public signature: /Impl.add|-2525808668243873976[0]
@@ -44,6 +44,7 @@ class C : A {
// Public signature: /C.<init>|-3166999336802030902[0]
// Public signature debug description: <init>(A){}
constructor(x: A) /* primary */
// CHECK JVM_IR:
// Mangled name: C#f(kotlin.String){}kotlin.String
// Public signature: /C.f|-2199490409267413998[0]
@@ -60,7 +61,6 @@ class C : A {
// Mangled name: A
// Public signature: /A|null[0]
interface A {
// CHECK JVM_IR:
// Mangled name: A#f(kotlin.String){}kotlin.String
// Public signature: /A.f|-2199490409267413998[0]
@@ -46,7 +46,6 @@ class Wrapper {
// Mangled name: Bar
// Public signature: /Bar|null[0]
interface Bar {
// CHECK:
// Mangled name: Bar{}foo
// Public signature: /Bar.foo|1688079488202778848[0]
@@ -148,7 +148,6 @@ class FirSession {
// Mangled name: Fir2IrComponents
// Public signature: /Fir2IrComponents|null[0]
interface Fir2IrComponents {
// CHECK:
// Mangled name: Fir2IrComponents{}classifierStorage
// Public signature: /Fir2IrComponents.classifierStorage|-9190759179670631614[0]
@@ -1,9 +1,7 @@
interface SymbolOwner<E : SymbolOwner<E>> {
}
interface Symbol<E : SymbolOwner<E>> {
}
interface ReceiverValue {
@@ -1,9 +1,7 @@
interface SymbolOwner<E : SymbolOwner<E>> {
}
interface Symbol<E : SymbolOwner<E>> {
}
interface ReceiverValue {
@@ -152,7 +152,6 @@ class PersistentImplicitReceiverStack : ImplicitReceiverStack, Iterable<Implicit
// Mangled name: ReceiverValue
// Public signature: /ReceiverValue|null[0]
interface ReceiverValue {
// CHECK:
// Mangled name: ReceiverValue{}type
// Public signature: /ReceiverValue.type|-6051055617123801408[0]
@@ -174,14 +173,12 @@ interface ReceiverValue {
// Mangled name: Symbol
// Public signature: /Symbol|null[0]
interface Symbol<E : SymbolOwner<E>> {
}
// CHECK:
// Mangled name: SymbolOwner
// Public signature: /SymbolOwner|null[0]
interface SymbolOwner<E : SymbolOwner<E>> {
}
// CHECK:
@@ -1,5 +1,4 @@
interface Substitutable<out T : DeclarationDescriptorNonRoot> {
}
abstract class ResolutionPart {
@@ -66,7 +66,6 @@ abstract class ResolutionPart {
// Mangled name: Substitutable
// Public signature: /Substitutable|null[0]
interface Substitutable<out T : DeclarationDescriptorNonRoot> {
}
// CHECK:
@@ -45,7 +45,6 @@ data class Some<T : Any?> {
}
interface MyList<T : Any?> : List<Some<T>> {
}
open class SomeList<T : Any?> : MyList<T>, ArrayList<Some<T>> {
@@ -45,7 +45,6 @@ data class Some<T : Any?> {
}
interface MyList<T : Any?> : List<Some<T>> {
}
open class SomeList<T : Any?> : MyList<T>, ArrayList<Some<T>> {
@@ -17,7 +17,6 @@ object Factory {
}
interface Base {
}
interface Delegate : Base {
@@ -26,7 +25,6 @@ interface Delegate : Base {
}
interface Derived : Delegate {
}
data class DataClass : Derived, Delegate {
@@ -17,7 +17,6 @@ object Factory {
}
interface Base {
}
interface Delegate : Base {
@@ -26,7 +25,6 @@ interface Delegate : Base {
}
interface Derived : Delegate {
}
data class DataClass : Derived, Delegate {
@@ -22,6 +22,7 @@ data class DataClass : Delegate, Derived {
// Public signature: /DataClass.<init>|7426992287025160657[0]
// Public signature debug description: <init>(Delegate){}
constructor(delegate: Delegate) /* primary */
// CHECK:
// Mangled name: DataClass#bar(){}
// Public signature: /DataClass.bar|496682602797471549[0]
@@ -84,14 +85,12 @@ data class DataClass : Delegate, Derived {
// Mangled name: Base
// Public signature: /Base|null[0]
interface Base {
}
// CHECK:
// Mangled name: Delegate
// Public signature: /Delegate|null[0]
interface Delegate : Base {
// CHECK:
// Mangled name: Delegate#bar(){}
// Public signature: /Delegate.bar|496682602797471549[0]
@@ -1,5 +1,4 @@
interface SimpleTypeMarker {
}
class SimpleType : SimpleTypeMarker {
@@ -46,14 +46,12 @@ class UserImpl {
// Mangled name: SimpleTypeMarker
// Public signature: /SimpleTypeMarker|null[0]
interface SimpleTypeMarker {
}
// CHECK:
// Mangled name: User
// Public signature: /User|null[0]
interface User {
// CHECK JVM_IR:
// Mangled name: User#bar@SimpleTypeMarker(){}kotlin.String
// Public signature: /User.bar|9149645946452319977[0]
@@ -34,7 +34,6 @@ open annotation class TypeParameterAnnBinary : Annotation {
}
interface Simple {
}
class SimpleClass {
@@ -47,7 +46,6 @@ class SimpleClass {
}
interface Generic<G : Any?> {
}
class GenericClass<G : Any?> {
@@ -153,13 +153,11 @@ class TypeParameterAsBound<Y : Any?, @TypeParameterAnn T : @TypeAnn(name = "Y as
// Mangled name: Generic
// Public signature: /Generic|null[0]
interface Generic<G : Any?> {
}
// CHECK:
// Mangled name: Simple
// Public signature: /Simple|null[0]
interface Simple {
}
@@ -25,7 +25,6 @@ abstract class AbstractFirBasedSymbol<E> where E : FirSymbolOwner<E>, E : FirDec
}
interface FirDeclaration {
}
interface FirSymbolOwner<E> where E : FirSymbolOwner<E>, E : FirDeclaration {
@@ -25,7 +25,6 @@ abstract class AbstractFirBasedSymbol<E> where E : FirSymbolOwner<E>, E : FirDec
}
interface FirDeclaration {
}
interface FirSymbolOwner<E> where E : FirSymbolOwner<E>, E : FirDeclaration {
@@ -61,7 +61,6 @@ class Candidate {
// Mangled name: FirCallableMemberDeclaration
// Public signature: /FirCallableMemberDeclaration|null[0]
interface FirCallableMemberDeclaration<F : FirCallableMemberDeclaration<F>> : FirDeclaration, FirSymbolOwner<F> {
// CHECK:
// Mangled name: FirCallableMemberDeclaration{}symbol
// Public signature: /FirCallableMemberDeclaration.symbol|-2022127689160258603[0]
@@ -83,14 +82,12 @@ interface FirCallableMemberDeclaration<F : FirCallableMemberDeclaration<F>> : Fi
// Mangled name: FirDeclaration
// Public signature: /FirDeclaration|null[0]
interface FirDeclaration {
}
// CHECK:
// Mangled name: FirSymbolOwner
// Public signature: /FirSymbolOwner|null[0]
interface FirSymbolOwner<E> where E : FirDeclaration, E : FirSymbolOwner<E> {
// CHECK:
// Mangled name: FirSymbolOwner{}symbol
// Public signature: /FirSymbolOwner.symbol|-2022127689160258603[0]
@@ -22,6 +22,7 @@ open class ControlFlowInfo<K : Any?, V : Any?> : Map<K, V> {
// Public signature: /ControlFlowInfo.<init>|2293537713863886898[0]
// Public signature debug description: <init>(kotlin.collections.Map<1:0,1:1>){}
constructor(map: Map<K, V>) /* primary */
// CHECK JVM_IR:
// Mangled name: ControlFlowInfo#containsKey(1:0){}kotlin.Boolean
// Public signature: /ControlFlowInfo.containsKey|-2697616884574929105[0]
@@ -133,6 +134,7 @@ class StringFlowInfo : ControlFlowInfo<String, String> {
// Public signature: /StringFlowInfo.<init>|4094084879849523083[0]
// Public signature debug description: <init>(kotlin.collections.Map<kotlin.String,kotlin.String>){}
constructor(map: Map<String, String>) /* primary */
// CHECK JVM_IR:
// Mangled name: StringFlowInfo#containsKey(kotlin.String){}kotlin.Boolean
// Public signature: /StringFlowInfo.containsKey|8275396622473115435[0]
@@ -22,6 +22,7 @@ class XAlign {
// Public signature: /XAlign.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor()
// CHECK:
// Mangled name: XAlign#<init>(kotlin.Long){}
// Public signature: /XAlign.<init>|5217973964116651322[0]
@@ -39,6 +39,7 @@ enum class ConfigurationParameter : Enum<ConfigurationParameter> {
// Public signature: /ConfigurationParameter.<init>|-5590500836156829531[0]
// Public signature debug description: <init>(kotlin.Function2<kotlin.String,Wrapper,kotlin.Unit>){}
private constructor(apply: Function2<String, Wrapper, Unit>)
// CHECK:
// Mangled name: ConfigurationParameter.BASE_URL
// Public signature: /ConfigurationParameter.BASE_URL|null[0]
@@ -1,5 +1,4 @@
interface Something {
}
interface Recursive<R> where R : Recursive<R>, R : Something {
@@ -1,5 +1,4 @@
interface Something {
}
interface Recursive<R> where R : Recursive<R>, R : Something {
@@ -20,7 +20,6 @@ abstract class AbstractSymbol<E> where E : Recursive<E>, E : Something {
// Mangled name: Recursive
// Public signature: /Recursive|null[0]
interface Recursive<R> where R : Recursive<R>, R : Something {
// CHECK:
// Mangled name: Recursive{}symbol
// Public signature: /Recursive.symbol|-2022127689160258603[0]
@@ -42,6 +41,5 @@ interface Recursive<R> where R : Recursive<R>, R : Something {
// Mangled name: Something
// Public signature: /Something|null[0]
interface Something {
}
@@ -14,7 +14,6 @@ open annotation class Ann : Annotation {
// Mangled name: I
// Public signature: /I|null[0]
interface I {
// CHECK:
// Mangled name: I#m(kotlin.String){}
// Public signature: /I.m|934693771674457301[0]
@@ -34,7 +34,6 @@ open class DelegatedB : B<String> {
}
interface B<out T : Any?> : A {
}
class C<out T : Any?> : B<T> {
@@ -34,7 +34,6 @@ open class DelegatedB : B<String> {
}
interface B<out T : Any?> : A {
}
class C<out T : Any?> : B<T> {
@@ -22,6 +22,7 @@ enum class EE : Enum<EE> {
// Public signature: /EE.<init>|1280618353163213788[0]
// Public signature debug description: <init>(kotlin.String){}
private constructor(myName: String) /* primary */
// CHECK:
// Mangled name: EE.ENTRY
// Public signature: /EE.ENTRY|null[0]
@@ -38,6 +38,7 @@ value class Z {
// Public signature: /Z.<init>|1280618353163213788[0]
// Public signature debug description: <init>(kotlin.String){}
constructor(s: String) /* primary */
// CHECK JVM_IR:
// Mangled name: Z#equals(kotlin.Any?){}kotlin.Boolean
// Public signature: /Z.equals|722809408929142791[0]