[FIR] Fix dispatch receivers on inner classes' constructors

1. Inner class constructor should have its outer class as a dispatch
receiver, since it is necessary for the call. Before it was null
2. Substituted inner class constructor should have its original dispatch
 receiver type with the proper substitution. Before it was set to the
 class itself (since the class was usually passed as a new dispatch
 receiver)

Also, modify FIR renderer, so it properly renders the dispatch receiver
of the constructors
This commit is contained in:
Roman Golyshev
2021-09-28 16:40:18 +03:00
committed by Space
parent 8673819260
commit 9b9c51bc8d
65 changed files with 169 additions and 129 deletions
@@ -4,7 +4,7 @@ KtFirConstructorSymbol:
annotations: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: java/util/ArrayList
dispatchType: java/util/ArrayList<E>
dispatchType: null
hasStableParameterNames: false
isExtension: false
isPrimary: false
@@ -1,5 +1,5 @@
public final inner [BODY_RESOLVE] class ONAIR<T> : R|X.BASE| {
public [BODY_RESOLVE] constructor(): R|X.ONAIR<T>| {
public [BODY_RESOLVE] X<T>.constructor(): R|X.ONAIR<T>| {
super<R|X.BASE|>()
}
@@ -22,7 +22,7 @@
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
public constructor(): R|A.B|
public A.constructor(): R|A.B|
}
@R|FieldsAreNullable|() public open inner class C : R|kotlin/Any| {
@@ -36,7 +36,7 @@
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
public constructor(): R|A.C|
public A.constructor(): R|A.C|
}
}
@@ -20,7 +20,7 @@ FILE: invokeWithReceiverAndArgument.kt
}
public final inner class LeafBuilderConfigurationContext<T : R|AbstractFirTreeBuilder|> : R|AbstractBuilderConfigurator.BuilderConfigurationContext| {
public constructor(): R|AbstractBuilderConfigurator.LeafBuilderConfigurationContext<T>| {
public AbstractBuilderConfigurator<T>.constructor(): R|AbstractBuilderConfigurator.LeafBuilderConfigurationContext<T>| {
super<R|AbstractBuilderConfigurator.BuilderConfigurationContext|>()
}
@@ -44,7 +44,7 @@ FILE: invokeWithReceiverAndArgument.kt
}
public final inner class Inner<E> : R|kotlin/Any| {
public constructor(): R|Outer.Inner<E>| {
public Outer<E>.constructor(): R|Outer.Inner<E>| {
super<R|kotlin/Any|>()
}
@@ -68,12 +68,12 @@ FILE: conflictingProjection.kt
}
public final inner class Intermediate<K, T> : R|kotlin/Any| {
public constructor<K>(): R|Outer.Intermediate<K, T>| {
public Outer<T>.constructor<K>(): R|Outer.Intermediate<K, T>| {
super<R|kotlin/Any|>()
}
public final inner class Inner<G, K, T> : R|kotlin/Any| {
public constructor<G>(): R|Outer.Intermediate.Inner<G, K, T>| {
public Outer.Intermediate<K, T>.constructor<G>(): R|Outer.Intermediate.Inner<G, K, T>| {
super<R|kotlin/Any|>()
}
@@ -115,12 +115,12 @@ FILE: conflictingProjection.kt
}
public final inner class OutIntermediate<out K, in T> : R|kotlin/Any| {
public constructor<out K>(): R|InOuter.OutIntermediate<K, T>| {
public InOuter<T>.constructor<out K>(): R|InOuter.OutIntermediate<K, T>| {
super<R|kotlin/Any|>()
}
public final inner class InInner<in G, out K, in T> : R|kotlin/Any| {
public constructor<in G>(): R|InOuter.OutIntermediate.InInner<G, K, T>| {
public InOuter.OutIntermediate<K, T>.constructor<in G>(): R|InOuter.OutIntermediate.InInner<G, K, T>| {
super<R|kotlin/Any|>()
}
@@ -162,12 +162,12 @@ FILE: conflictingProjection.kt
}
public final inner class TwoParametersIntermediate<out K, K1, T, in T1> : R|kotlin/Any| {
public constructor<out K, K1>(): R|TwoParametersOuter.TwoParametersIntermediate<K, K1, T, T1>| {
public TwoParametersOuter<T, T1>.constructor<out K, K1>(): R|TwoParametersOuter.TwoParametersIntermediate<K, K1, T, T1>| {
super<R|kotlin/Any|>()
}
public final inner class InInner<in G, G1, out K, K1, T, in T1> : R|kotlin/Any| {
public constructor<in G, G1>(): R|TwoParametersOuter.TwoParametersIntermediate.InInner<G, G1, K, K1, T, T1>| {
public TwoParametersOuter.TwoParametersIntermediate<K, K1, T, T1>.constructor<in G, G1>(): R|TwoParametersOuter.TwoParametersIntermediate.InInner<G, G1, K, K1, T, T1>| {
super<R|kotlin/Any|>()
}
@@ -106,7 +106,7 @@ FILE: incompatibleModifiers.kt
}
public final inner data class Y : R|kotlin/Any| {
public constructor(i: R|kotlin/Int|): R|X.Y| {
public X.constructor(i: R|kotlin/Int|): R|X.Y| {
super<R|kotlin/Any|>()
}
@@ -120,7 +120,7 @@ FILE: incompatibleModifiers.kt
}
public sealed inner class Z : R|kotlin/Any| {
protected constructor(): R|X.Z| {
protected X.constructor(): R|X.Z| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: innerQualifier.kt
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Outer.Inner| {
public Outer.constructor(): R|Outer.Inner| {
super<R|kotlin/Any|>()
}
@@ -24,7 +24,7 @@ FILE: innerWithSuperCompanion.kt
public get(): R|kotlin/String|
public final inner class Inner : R|Base| {
public constructor(): R|Outer.Inner| {
public Outer.constructor(): R|Outer.Inner| {
super<R|Base|>()
}
@@ -12,7 +12,7 @@ FILE: localInnerClass.kt
}
local final inner class Derived : R|Foo| {
public constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
public <anonymous>.constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
super<R|kotlin/Any|>()
}
@@ -12,7 +12,7 @@ FILE: nestedVisibility.kt
}
private final inner class PrivateInner : R|kotlin/Any| {
public constructor(): R|Outer.PrivateInner| {
public Outer.constructor(): R|Outer.PrivateInner| {
super<R|kotlin/Any|>()
}
@@ -26,7 +26,7 @@ FILE: nestedVisibility.kt
}
protected final inner class ProtectedInner : R|kotlin/Any| {
public constructor(): R|Outer.ProtectedInner| {
public Outer.constructor(): R|Outer.ProtectedInner| {
super<R|kotlin/Any|>()
}
@@ -40,7 +40,7 @@ FILE: nestedVisibility.kt
}
public final inner class PublicInner : R|kotlin/Any| {
public constructor(): R|Outer.PublicInner| {
public Outer.constructor(): R|Outer.PublicInner| {
super<R|kotlin/Any|>()
}
@@ -22,7 +22,7 @@ FILE: O.kt
private get(): R|kotlin/Int|
private final inner class Some : R|kotlin/Any| {
public constructor(z: R|kotlin/Boolean|): R|O.Derived.Some| {
public O.Derived.constructor(z: R|kotlin/Boolean|): R|O.Derived.Some| {
super<R|kotlin/Any|>()
}
@@ -17,7 +17,7 @@ FILE: first.kt
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Private.Inner| {
public Private.constructor(): R|Private.Inner| {
super<R|kotlin/Any|>()
}
@@ -76,7 +76,7 @@ FILE: first.kt
}
local final inner class Inner : R|kotlin/Any| {
public constructor(): R|Local.Inner| {
public Local.constructor(): R|Local.Inner| {
super<R|kotlin/Any|>()
}
@@ -13,7 +13,7 @@ FILE: protectedVisibility.kt
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Protected.Inner| {
public Protected.constructor(): R|Protected.Inner| {
super<R|kotlin/Any|>()
}
@@ -12,7 +12,7 @@ FILE: topExtensionVsOuterMember.kt
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Outer.Inner| {
public Outer.constructor(): R|Outer.Inner| {
super<R|kotlin/Any|>()
}
@@ -45,7 +45,7 @@ FILE: RedundantVisibilityModifierChecker.kt
}
internal final inner class B<T, T2, T1, T2 : R|T1|> : R|kotlin/Any| {
public constructor<T, T2>(): R|Foo2.B<T, T2, T1, T2>| {
public Foo2<T1, T2>.constructor<T, T2>(): R|Foo2.B<T, T2, T1, T2>| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: complexTypes.kt
}
public final inner class D<R, in P, T, out S> : R|kotlin/Any| {
public constructor<R, in P>(): R|a/b/C.D<R, P, T, S>| {
public a/b/C<T, S>.constructor<R, in P>(): R|a/b/C.D<R, P, T, S>| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: inlineClassDeclaration.kt
}
public final inner inline class B : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|): R|A.B| {
public A.constructor(x: R|kotlin/Int|): R|A.B| {
super<R|kotlin/Any|>()
}
@@ -28,7 +28,7 @@ FILE: inlineClassDeclaration.kt
}
public final inner inline class D : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|): R|A.D| {
public A.constructor(x: R|kotlin/Int|): R|A.D| {
super<R|kotlin/Any|>()
}
@@ -91,7 +91,7 @@ FILE: inlineClassMembers.kt
public get(): R|kotlin/String|
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|WithInner.Inner| {
public WithInner.constructor(): R|WithInner.Inner| {
super<R|kotlin/Any|>()
}
@@ -18,7 +18,7 @@ FILE: inner.kt
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Owner.Inner| {
public Owner.constructor(): R|Owner.Inner| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: innerTypeFromSuperClassInBody.kt
}
public final inner class Inner<X : R|kotlin/CharSequence|> : R|kotlin/Any| {
public constructor(): R|A.Inner<X>| {
public A<X>.constructor(): R|A.Inner<X>| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: innerTypes.kt
}
public final inner class Inner<K, T> : R|kotlin/Any| {
public constructor<K>(): R|Outer.Inner<K, T>| {
public Outer<T>.constructor<K>(): R|Outer.Inner<K, T>| {
super<R|kotlin/Any|>()
}
@@ -49,7 +49,7 @@ FILE: implicitInLocalClasses.kt
public get(): R|B.Inner|
local final inner class Inner : R|kotlin/Any| {
public constructor(): R|B.Inner| {
public B.constructor(): R|B.Inner| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: objectInnerClass.kt
}
local final inner class Child : R|<anonymous>.Base| {
public constructor(property: R|B|): R|<anonymous>.Child| {
public <anonymous>.constructor(property: R|B|): R|<anonymous>.Child| {
this@R|/<anonymous>|.super<R|<anonymous>.Base|>(R|<local>/property|)
}
@@ -31,7 +31,7 @@ FILE: objectInnerClass.kt
}
local open inner class Base : R|kotlin/Any| {
public constructor(property: R|B|): R|<anonymous>.Base| {
public <anonymous>.constructor(property: R|B|): R|<anonymous>.Base| {
super<R|kotlin/Any|>()
}
@@ -92,7 +92,7 @@ FILE: objectInnerClass.kt
}
public open inner class Base : R|kotlin/Any| {
public constructor(property: R|B|): R|Case2.Base| {
public Case2.constructor(property: R|B|): R|Case2.Base| {
super<R|kotlin/Any|>()
}
@@ -130,7 +130,7 @@ FILE: objectInnerClass.kt
}
local final inner class Child : R|Case3.<anonymous>.Base| {
public constructor(property: R|B|): R|Case3.<anonymous>.Child| {
public <anonymous>.constructor(property: R|B|): R|Case3.<anonymous>.Child| {
this@R|/<anonymous>|.super<R|Case3.<anonymous>.Base|>(R|<local>/property|)
}
@@ -156,7 +156,7 @@ FILE: objectInnerClass.kt
}
local open inner class Base : R|kotlin/Any| {
public constructor(property: R|B|): R|Case3.<anonymous>.Base| {
public <anonymous>.constructor(property: R|B|): R|Case3.<anonymous>.Base| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: innerClassHierarchy.kt
}
public open inner class Inner : R|kotlin/Any| {
public constructor(): R|Base.Inner| {
public Base.constructor(): R|Base.Inner| {
super<R|kotlin/Any|>()
}
@@ -18,17 +18,17 @@ FILE: innerClassHierarchy.kt
}
public final inner class InnerDerived : R|Base.Inner| {
public constructor(): R|Derived.InnerDerived| {
public Derived.constructor(): R|Derived.InnerDerived| {
this@R|/Derived|.super<R|Base.Inner|>()
}
public final inner class VeryInner : R|Base.Inner| {
public constructor(): R|Derived.InnerDerived.VeryInner| {
public Derived.InnerDerived.constructor(): R|Derived.InnerDerived.VeryInner| {
this@R|/Derived|.super<R|Base.Inner|>()
}
public final inner class VeryVeryInner : R|Base.Inner| {
public constructor(): R|Derived.InnerDerived.VeryInner.VeryVeryInner| {
public Derived.InnerDerived.VeryInner.constructor(): R|Derived.InnerDerived.VeryInner.VeryVeryInner| {
this@R|/Derived|.super<R|Base.Inner|>()
}
@@ -48,35 +48,35 @@ FILE: innerClassHierarchy.kt
public get(): R|kotlin/String|
public open inner class B : R|A| {
public constructor(s: R|kotlin/String|): R|A.B| {
public A.constructor(s: R|kotlin/String|): R|A.B| {
super<R|A|>(R|<local>/s|)
}
}
public open inner class C : R|A.B| {
public constructor(s: R|kotlin/String|, additional: R|kotlin/Double|): R|A.C| {
public A.constructor(s: R|kotlin/String|, additional: R|kotlin/Double|): R|A.C| {
this@R|/A|.super<R|A.B|>(R|<local>/s|)
}
}
public open inner class D : R|A.C| {
public constructor(other: R|kotlin/Int|, another: R|kotlin/Long|, s: R|kotlin/String|): R|A.D| {
public A.constructor(other: R|kotlin/Int|, another: R|kotlin/Long|, s: R|kotlin/String|): R|A.D| {
this@R|/A|.super<R|A.C|>(R|<local>/s|, R|<local>/another|.R|kotlin/Long.toDouble|())
}
}
public open inner class E : R|A.D| {
public constructor(): R|A.E| {
public A.constructor(): R|A.E| {
this@R|/A|.super<R|A.D|>(Int(0), Long(42), String(OK))
}
}
public final inner class F : R|A.E| {
public constructor(): R|A.F| {
public A.constructor(): R|A.F| {
this@R|/A|.super<R|A.E|>()
}
@@ -5,7 +5,7 @@ FILE: objectDerivedFromInnerClass.kt
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Outer.Inner| {
public Outer.constructor(): R|Outer.Inner| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: throwableSubclass.kt
}
public final inner class Test2<S, T, B> : R|kotlin/Throwable| {
public constructor<S>(): R|Test1.Test2<S, T, B>| {
public Test1<T, B>.constructor<S>(): R|Test1.Test2<S, T, B>| {
super<R|kotlin/Throwable|>()
}
@@ -32,7 +32,7 @@ FILE: throwableSubclass.kt
}
public final inner class Test6<T, B> : R|kotlin/Exception| {
public constructor(): R|Test5.Test6<T, B>| {
public Test5<T, B>.constructor(): R|Test5.Test6<T, B>| {
super<R|kotlin/Exception|>()
}
@@ -7,7 +7,7 @@ FILE: typeParameterVsNested.kt
}
public final inner class T<T : R|test/Some|> : R|kotlin/Any| {
public constructor(): R|test/My.T<T>| {
public test/My<T>.constructor(): R|test/My.T<T>| {
super<R|kotlin/Any|>()
}
@@ -5,12 +5,12 @@ FILE: capturedParametersOfInnerClasses.kt
}
public final inner class B<K1, K2, T1, T2> : R|kotlin/Any| {
public constructor<K1, K2>(): R|A.B<K1, K2, T1, T2>| {
public A<T1, T2>.constructor<K1, K2>(): R|A.B<K1, K2, T1, T2>| {
super<R|kotlin/Any|>()
}
public final inner class C<U1, U2, K1, K2, T1, T2> : R|kotlin/Any| {
public constructor<U1, U2>(): R|A.B.C<U1, U2, K1, K2, T1, T2>| {
public A.B<K1, K2, T1, T2>.constructor<U1, U2>(): R|A.B.C<U1, U2, K1, K2, T1, T2>| {
super<R|kotlin/Any|>()
}
@@ -24,7 +24,7 @@ FILE: exposedSupertype.kt
}
public final inner class BInner : R|kotlin/Any| {
public constructor(): R|B.BInner| {
public B.constructor(): R|B.BInner| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: exposedTypeAlias.kt
}
private final inner class Inner : R|kotlin/Any| {
public constructor(): R|A.Inner| {
public A.constructor(): R|A.Inner| {
super<R|kotlin/Any|>()
}
@@ -20,7 +20,7 @@ FILE: exposedTypeAlias.kt
public final typealias AInner = R|A.Inner|
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|B.Inner| {
public B.constructor(): R|B.Inner| {
super<R|kotlin/Any|>()
}
@@ -25,7 +25,7 @@ FILE: K3.kt
}
public open inner class NestedInSuperClass<T> : R|kotlin/Any| {
public constructor(): R|SuperClass.NestedInSuperClass<T>| {
public SuperClass<T>.constructor(): R|SuperClass.NestedInSuperClass<T>| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: K1.kt
}
public open inner class KotlinInner : R|kotlin/Any| {
public constructor(): R|KotlinOuter.KotlinInner| {
public KotlinOuter.constructor(): R|KotlinOuter.KotlinInner| {
super<R|kotlin/Any|>()
}
@@ -30,7 +30,7 @@ FILE: K2.kt
}
public final inner class K3 : R|J1.J2| {
public constructor(): R|K2.K3| {
public K2.constructor(): R|K2.K3| {
this@R|/K2|.super<R|J1.J2|>()
}
@@ -9,19 +9,17 @@ import org.jetbrains.kotlin.fir.analysis.checkers.FirTypeRefSource
import org.jetbrains.kotlin.fir.analysis.checkers.checkUpperBoundViolated
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.fir.declarations.FirConstructor
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression
import org.jetbrains.kotlin.fir.expressions.toResolvedCallableSymbol
import org.jetbrains.kotlin.fir.references.FirErrorNamedReference
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeInapplicableCandidateError
import org.jetbrains.kotlin.fir.resolve.calls.isTypeAliasedConstructor
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeInapplicableWrongReceiver
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
import org.jetbrains.kotlin.fir.types.FirTypeProjection
import org.jetbrains.kotlin.fir.types.FirTypeProjectionWithVariance
import org.jetbrains.kotlin.fir.types.toSymbol
import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability
object FirUpperBoundViolatedExpressionChecker : FirQualifiedAccessExpressionChecker() {
override fun check(expression: FirQualifiedAccessExpression, context: CheckerContext, reporter: DiagnosticReporter) {
@@ -40,16 +38,20 @@ object FirUpperBoundViolatedExpressionChecker : FirQualifiedAccessExpressionChec
calleeSymbol = calleReference.candidateSymbol as? FirCallableSymbol<*>
}
var typeArguments: List<Any>? = null
var typeArgumentRefsAndSources: List<FirTypeRefSource?>? = null
val typeParameters = if (calleeSymbol is FirConstructorSymbol) {
typeArgumentRefsAndSources =
expression.typeArguments.map { FirTypeRefSource((it as? FirTypeProjectionWithVariance)?.typeRef, it.source) }
val prototypeClass = calleeSymbol.dispatchReceiverType?.toSymbol(context.session) as? FirRegularClassSymbol
prototypeClass?.typeParameterSymbols
val typeArguments: List<FirTypeProjection>?
val typeArgumentRefsAndSources: List<FirTypeRefSource>?
val typeParameters: List<FirTypeParameterSymbol>?
if (calleeSymbol is FirConstructorSymbol && calleeSymbol.isTypeAliasedConstructor) {
typeArguments = null
typeArgumentRefsAndSources = expression.typeArguments.map {
FirTypeRefSource((it as? FirTypeProjectionWithVariance)?.typeRef, it.source)
}
typeParameters = null
} else {
typeArguments = expression.typeArguments
calleeSymbol?.typeParameterSymbols
typeArgumentRefsAndSources = null
typeParameters = calleeSymbol?.typeParameterSymbols
}
checkUpperBoundViolated(
@@ -247,7 +247,8 @@ class FirJavaFacade(
javaClass,
ownerClassBuilder = this,
classTypeParameters,
javaTypeParameterStack
javaTypeParameterStack,
parentClassSymbol,
)
}
for (javaConstructor in javaClassDeclaredConstructors) {
@@ -258,6 +259,7 @@ class FirJavaFacade(
ownerClassBuilder = this,
classTypeParameters,
javaTypeParameterStack,
parentClassSymbol,
)
}
@@ -440,6 +442,7 @@ class FirJavaFacade(
ownerClassBuilder: FirJavaClassBuilder,
classTypeParameters: List<FirTypeParameter>,
javaTypeParameterStack: JavaTypeParameterStack,
outerClassSymbol: FirRegularClassSymbol?,
): FirJavaConstructor {
val constructorSymbol = FirConstructorSymbol(constructorId)
return buildJavaConstructor {
@@ -464,6 +467,7 @@ class FirJavaFacade(
returnTypeRef = buildResolvedTypeRef {
type = ownerClassBuilder.buildSelfTypeRef()
}
dispatchReceiverType = if (isThisInner) outerClassSymbol?.defaultType() else null
typeParameters += classTypeParameters.map { buildConstructedClassTypeParameterRef { symbol = it.symbol } }
if (javaConstructor != null) {
@@ -39,7 +39,6 @@ import org.jetbrains.kotlin.fir.lightTree.fir.modifier.TypeProjectionModifier
import org.jetbrains.kotlin.fir.references.builder.buildExplicitSuperReference
import org.jetbrains.kotlin.fir.references.builder.buildExplicitThisReference
import org.jetbrains.kotlin.fir.references.builder.buildSimpleNamedReference
import org.jetbrains.kotlin.fir.references.impl.FirReferencePlaceholderForResolvedAnnotations
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.impl.*
@@ -843,6 +842,7 @@ class DeclarationsConverter(
moduleData = baseModuleData
origin = FirDeclarationOrigin.Source
returnTypeRef = classWrapper.delegatedSelfTypeRef
dispatchReceiverType = classWrapper.obtainDispatchReceiverForConstructor()
this.status = status
symbol = FirConstructorSymbol(callableIdForClassConstructor())
annotations += modifiers.annotations
@@ -911,6 +911,7 @@ class DeclarationsConverter(
moduleData = baseModuleData
origin = FirDeclarationOrigin.Source
returnTypeRef = delegatedSelfTypeRef
dispatchReceiverType = classWrapper.obtainDispatchReceiverForConstructor()
this.status = status
symbol = FirConstructorSymbol(callableIdForClassConstructor())
delegatedConstructor = constructorDelegationCall
@@ -928,6 +929,9 @@ class DeclarationsConverter(
}
}
private fun ClassWrapper.obtainDispatchReceiverForConstructor(): ConeClassLikeType? =
if (isInner()) dispatchReceiverForInnerClassConstructor() else null
/**
* @see org.jetbrains.kotlin.fir.builder.RawFirBuilder.Visitor.convert(
* KtConstructorDelegationCall, FirTypeRef, Boolean)
@@ -847,6 +847,7 @@ open class RawFirBuilder(
origin = FirDeclarationOrigin.Source
returnTypeRef = delegatedSelfTypeRef
this.status = status
dispatchReceiverType = owner.obtainDispatchReceiverForConstructor()
symbol = FirConstructorSymbol(callableIdForClassConstructor())
delegatedConstructor = firDelegatedCall
typeParameters += constructorTypeParametersFromConstructedClass(ownerTypeParameters)
@@ -858,6 +859,9 @@ open class RawFirBuilder(
}
}
private fun KtClassOrObject.obtainDispatchReceiverForConstructor(): ConeClassLikeType? =
if (hasModifier(INNER_KEYWORD)) dispatchReceiverForInnerClassConstructor() else null
override fun visitKtFile(file: KtFile, data: Unit): FirElement {
context.packageFqName = if (psiMode == PsiHandlingMode.COMPILER) file.packageFqNameByTree else file.packageFqName
return buildFile {
@@ -1388,6 +1392,7 @@ open class RawFirBuilder(
isFromSealedClass = owner.hasModifier(SEALED_KEYWORD) && explicitVisibility !== Visibilities.Private
isFromEnumClass = owner.hasModifier(ENUM_KEYWORD)
}
dispatchReceiverType = owner.obtainDispatchReceiverForConstructor()
symbol = FirConstructorSymbol(callableIdForClassConstructor())
delegatedConstructor = getDelegationCall().convert(
delegatedSuperTypeRef,
@@ -5,7 +5,7 @@ FILE: complexTypes.kt
}
public? final? inner class D<R, in P, T, out S> : R|kotlin/Any| {
public? constructor<R, in P>(): R|a/b/C.D<R, P, T, S>| {
public? a/b/C<T, S>.constructor<R, in P>(): R|a/b/C.D<R, P, T, S>| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: complexTypes.kt
}
public? final? inner class D<R, in P, T, out S> : R|kotlin/Any| {
public? [ContainingClassKey=D] constructor<R, in P>(): R|a/b/C.D<R, P, T, S>| {
public? [ContainingClassKey=D] a/b/C<T, S>.constructor<R, in P>(): R|a/b/C.D<R, P, T, S>| {
super<R|kotlin/Any|>()
}
@@ -7,7 +7,7 @@ FILE: typeParameterVsNested.kt
}
public? final? inner class T<T : Some> : R|kotlin/Any| {
public? constructor(): R|test/My.T<T>| {
public? test/My<T>.constructor(): R|test/My.T<T>| {
super<R|kotlin/Any|>()
}
@@ -7,7 +7,7 @@ FILE: typeParameterVsNested.kt
}
public? final? inner class T<T : Some> : R|kotlin/Any| {
public? [ContainingClassKey=T] constructor(): R|test/My.T<T>| {
public? [ContainingClassKey=T] test/My<T>.constructor(): R|test/My.T<T>| {
super<R|kotlin/Any|>()
}
@@ -131,6 +131,14 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
fun currentDispatchReceiverType(): ConeClassLikeType? = currentDispatchReceiverType(context)
/**
* @return second from the end dispatch receiver. For the inner class constructor it would be the outer class.
*/
protected fun dispatchReceiverForInnerClassConstructor(): ConeClassLikeType? {
val dispatchReceivers = context.dispatchReceiverTypesStack
return dispatchReceivers.getOrNull(dispatchReceivers.lastIndex - 1)
}
fun callableIdForClassConstructor() =
if (context.className == FqName.ROOT) CallableId(context.packageFqName, Name.special("<anonymous-init>"))
else CallableId(context.packageFqName, context.className, context.className.shortName())
@@ -260,3 +260,6 @@ private class TypeAliasConstructorsSubstitutingScope(
private object TypeAliasConstructorKey : FirDeclarationDataKey()
var FirConstructor.originalConstructorIfTypeAlias: FirConstructor? by FirDeclarationDataRegistry.data(TypeAliasConstructorKey)
val FirConstructorSymbol.isTypeAliasedConstructor: Boolean
get() = fir.originalConstructorIfTypeAlias != null
@@ -175,6 +175,12 @@ class FirClassSubstitutionScope(
val constructor = original.fir
val (newTypeParameters, _, _, newReturnType, newSubstitutor, fakeOverrideSubstitution) = createSubstitutedData(constructor)
// If constructor has a dispatch receiver, it should be an inner class' constructor.
// It means that we need to substitute its dispatcher as every other type,
// instead of using dispatchReceiverTypeForSubstitutedMembers
val newDispatchReceiverType = original.dispatchReceiverType?.substitute(substitutor)
val newParameterTypes = constructor.valueParameters.map {
it.returnTypeRef.coneType.substitute(newSubstitutor)
}
@@ -185,8 +191,14 @@ class FirClassSubstitutionScope(
return FirFakeOverrideGenerator.createSubstitutionOverrideConstructor(
FirConstructorSymbol(original.callableId),
session, constructor, dispatchReceiverTypeForSubstitutedMembers,
newReturnType, newParameterTypes, newTypeParameters, makeExpect, fakeOverrideSubstitution
session,
constructor,
newDispatchReceiverType,
newReturnType,
newParameterTypes,
newTypeParameters,
makeExpect,
fakeOverrideSubstitution
).symbol
}
@@ -20,10 +20,7 @@ import org.jetbrains.kotlin.fir.expressions.impl.*
import org.jetbrains.kotlin.fir.references.*
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
import org.jetbrains.kotlin.fir.symbols.impl.*
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
import org.jetbrains.kotlin.name.Name
@@ -568,6 +565,11 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
print("actual ")
}
constructor.renderDeclarationData()
constructor.dispatchReceiverType?.let {
print(it.render())
print(".")
}
print("constructor")
constructor.typeParameters.renderTypeParameters()
constructor.valueParameters.renderParameters()
+1 -1
View File
@@ -2,7 +2,7 @@ public open class InnerClass : R|kotlin/Any| {
public constructor(): R|test/InnerClass|
public open inner class Inner : R|kotlin/Any| {
public constructor(): R|test/InnerClass.Inner|
public test/InnerClass.constructor(): R|test/InnerClass.Inner|
}
}
@@ -2,7 +2,7 @@ public open class InnerClassReferencesOuterTP<P : R|ft<kotlin/Any, kotlin/Any?>|
public constructor<P : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassReferencesOuterTP<P>|
public open inner class Inner<Q : R|ft<P, P?>|, P : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public constructor<Q : R|ft<P, P?>|>(): R|test/InnerClassReferencesOuterTP.Inner<Q, P>|
public test/InnerClassReferencesOuterTP<P>.constructor<Q : R|ft<P, P?>|>(): R|test/InnerClassReferencesOuterTP.Inner<Q, P>|
}
}
@@ -4,20 +4,20 @@ public open class InnerClassTypeMultipleGeneric : R|kotlin/Any| {
public constructor(): R|test/InnerClassTypeMultipleGeneric|
public open inner class BaseOuter<H1 : R|ft<kotlin/Any, kotlin/Any?>|, H2 : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public constructor<H1 : R|ft<kotlin/Any, kotlin/Any?>|, H2 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.BaseOuter<H1, H2>|
public test/InnerClassTypeMultipleGeneric.constructor<H1 : R|ft<kotlin/Any, kotlin/Any?>|, H2 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.BaseOuter<H1, H2>|
public abstract inner class BaseInner<H3 : R|ft<kotlin/Any, kotlin/Any?>|, H4 : R|ft<kotlin/Any, kotlin/Any?>|, H1 : R|ft<kotlin/Any, kotlin/Any?>|, H2 : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public constructor<H3 : R|ft<kotlin/Any, kotlin/Any?>|, H4 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.BaseOuter.BaseInner<H3, H4, H1, H2>|
public test/InnerClassTypeMultipleGeneric.BaseOuter<H1, H2>.constructor<H3 : R|ft<kotlin/Any, kotlin/Any?>|, H4 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.BaseOuter.BaseInner<H3, H4, H1, H2>|
}
}
public open inner class Outer<E1 : R|ft<kotlin/Any, kotlin/Any?>|, E2 : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/InnerClassTypeMultipleGeneric.BaseOuter<ft<kotlin/Int, kotlin/Int?>, ft<E1, E1?>>| {
public open fun bar(): R|ft<test/InnerClassTypeMultipleGeneric.BaseOuter.BaseInner<ft<java/lang/Class<*>, java/lang/Class<*>?>, ft<kotlin/CharSequence, kotlin/CharSequence?>, ft<kotlin/Int, kotlin/Int?>, ft<E1, E1?>>, test/InnerClassTypeMultipleGeneric.BaseOuter.BaseInner<ft<java/lang/Class<*>, java/lang/Class<*>?>, ft<kotlin/CharSequence, kotlin/CharSequence?>, ft<kotlin/Int, kotlin/Int?>, ft<E1, E1?>>?>|
public constructor<E1 : R|ft<kotlin/Any, kotlin/Any?>|, E2 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.Outer<E1, E2>|
public test/InnerClassTypeMultipleGeneric.constructor<E1 : R|ft<kotlin/Any, kotlin/Any?>|, E2 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.Outer<E1, E2>|
public open inner class Inner<E3 : R|ft<kotlin/Any, kotlin/Any?>|, E1 : R|ft<kotlin/Any, kotlin/Any?>|, E2 : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/InnerClassTypeMultipleGeneric.BaseOuter.BaseInner<ft<kotlin/Double, kotlin/Double?>, ft<kotlin/String, kotlin/String?>, ft<E2, E2?>, ft<E3, E3?>>| {
public constructor<E3 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.Outer.Inner<E3, E1, E2>|
public test/InnerClassTypeMultipleGeneric.Outer<E1, E2>.constructor<E3 : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassTypeMultipleGeneric.Outer.Inner<E3, E1, E2>|
}
}
@@ -2,13 +2,13 @@ public open class InnerClassesInGeneric<P : R|ft<kotlin/Any, kotlin/Any?>|, Q :
public constructor<P : R|ft<kotlin/Any, kotlin/Any?>|, Q : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerClassesInGeneric<P, Q>|
public open inner class Inner<P : R|ft<kotlin/Any, kotlin/Any?>|, Q : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public constructor(): R|test/InnerClassesInGeneric.Inner<P, Q>|
public test/InnerClassesInGeneric<P, Q>.constructor(): R|test/InnerClassesInGeneric.Inner<P, Q>|
}
public open inner class Inner2<P : R|ft<kotlin/Any, kotlin/Any?>|, Q : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/InnerClassesInGeneric.Inner<ft<P, P?>, ft<Q, Q?>>| {
public open operator fun iterator(): R|ft<kotlin/collections/MutableIterator<ft<P, P?>>, kotlin/collections/Iterator<ft<P, P?>>?>|
public constructor(): R|test/InnerClassesInGeneric.Inner2<P, Q>|
public test/InnerClassesInGeneric<P, Q>.constructor(): R|test/InnerClassesInGeneric.Inner2<P, Q>|
}
}
@@ -2,27 +2,27 @@ public open class InnerOfGeneric : R|kotlin/Any| {
public constructor(): R|test/InnerOfGeneric|
public abstract inner class A<K : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public constructor<K : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerOfGeneric.A<K>|
public test/InnerOfGeneric.constructor<K : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerOfGeneric.A<K>|
public abstract inner class Inner<K : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/InnerOfGeneric.S<ft<K, K?>>| {
public constructor(): R|test/InnerOfGeneric.A.Inner<K>|
public test/InnerOfGeneric.A<K>.constructor(): R|test/InnerOfGeneric.A.Inner<K>|
}
}
public open inner class B<L : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/InnerOfGeneric.A<ft<L, L?>>| {
public constructor<L : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerOfGeneric.B<L>|
public test/InnerOfGeneric.constructor<L : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerOfGeneric.B<L>|
public open inner class SubInner<L : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/InnerOfGeneric.A.Inner<ft<L, L?>>| {
@R|java/lang/Override|() public open operator fun iterator(): R|ft<kotlin/collections/MutableIterator<ft<L, L?>>, kotlin/collections/Iterator<ft<L, L?>>?>|
public constructor(): R|test/InnerOfGeneric.B.SubInner<L>|
public test/InnerOfGeneric.B<L>.constructor(): R|test/InnerOfGeneric.B.SubInner<L>|
}
}
public open inner class S<E : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public open operator fun iterator(): R|ft<kotlin/collections/MutableIterator<ft<E, E?>>, kotlin/collections/Iterator<ft<E, E?>>?>|
public constructor<E : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerOfGeneric.S<E>|
public test/InnerOfGeneric.constructor<E : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/InnerOfGeneric.S<E>|
}
}
@@ -4,7 +4,7 @@ public final class MethodReferencesOuterClassTP<P : R|ft<kotlin/Any, kotlin/Any?
public final inner class Inner<P : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public final fun <Q : R|ft<P, P?>|> f(): R|kotlin/Unit|
public constructor(): R|test/MethodReferencesOuterClassTP.Inner<P>|
public test/MethodReferencesOuterClassTP<P>.constructor(): R|test/MethodReferencesOuterClassTP.Inner<P>|
}
}
@@ -6,7 +6,7 @@ public open class OverrideMethod : R|kotlin/Any| {
public/*package*/ open fun bar(): R|kotlin/Unit|
public/*package*/ constructor(): R|test/OverrideMethod.Base|
public/*package*/ test/OverrideMethod.constructor(): R|test/OverrideMethod.Base|
}
public/*package*/ open inner class Derived : R|test/OverrideMethod.Base| {
@@ -14,13 +14,13 @@ public open class OverrideMethod : R|kotlin/Any| {
public/*package*/ open fun baz(): R|kotlin/Unit|
public/*package*/ constructor(): R|test/OverrideMethod.Derived|
public/*package*/ test/OverrideMethod.constructor(): R|test/OverrideMethod.Derived|
}
public/*package*/ open inner class SuperBase : R|kotlin/Any| {
public/*package*/ open fun quux(x: R|kotlin/Int|): R|kotlin/Unit|
public/*package*/ constructor(): R|test/OverrideMethod.SuperBase|
public/*package*/ test/OverrideMethod.constructor(): R|test/OverrideMethod.SuperBase|
}
}
@@ -10,7 +10,7 @@ public open class PrivateMembers : R|kotlin/Any| {
private constructor(): R|test/PrivateMembers|
private open inner class Inner : R|kotlin/Any| {
private constructor(): R|test/PrivateMembers.Inner|
private test/PrivateMembers.constructor(): R|test/PrivateMembers.Inner|
}
private open class Nested : R|kotlin/Any| {
@@ -8,13 +8,13 @@ public open class RawOverrides : R|kotlin/Any| {
public open inner class B : R|kotlin/Any|, R|test/RawOverrides.A<ft<kotlin/Any, kotlin/Any?>>| {
@R|java/lang/Override|() public open fun foo(x: R|ft<kotlin/Any, kotlin/Any?>|, y: R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|): R|ft<kotlin/String, kotlin/String?>|
public constructor(): R|test/RawOverrides.B|
public test/RawOverrides.constructor(): R|test/RawOverrides.B|
}
public open inner class C : R|kotlin/Any| {
public/*package*/ open fun <E : R|ft<kotlin/CharSequence, kotlin/CharSequence?>|, F : R|ft<E, E?>|> bar(x: R|ft<F, F?>|, y: R|ft<kotlin/collections/MutableList<ft<kotlin/collections/MutableMap<ft<E, E?>, ft<F, F?>>, kotlin/collections/Map<ft<E, E?>, ft<F, F?>>?>>, kotlin/collections/List<ft<kotlin/collections/MutableMap<ft<E, E?>, ft<F, F?>>, kotlin/collections/Map<ft<E, E?>, ft<F, F?>>?>>?>|): R|ft<E, E?>|
public constructor(): R|test/RawOverrides.C|
public test/RawOverrides.constructor(): R|test/RawOverrides.C|
}
public open inner class D : R|test/RawOverrides.C| {
@@ -22,7 +22,7 @@ public open class RawOverrides : R|kotlin/Any| {
public/*package*/ open fun <E : R|ft<kotlin/CharSequence, kotlin/CharSequence?>|, F : R|ft<E, E?>|> bar(x: R|ft<F, F?>|, y: R|ft<kotlin/collections/MutableList<ft<kotlin/collections/MutableMap<ft<E, E?>, ft<F, F?>>, kotlin/collections/Map<ft<E, E?>, ft<F, F?>>?>>, kotlin/collections/List<ft<kotlin/collections/MutableMap<ft<E, E?>, ft<F, F?>>, kotlin/collections/Map<ft<E, E?>, ft<F, F?>>?>>?>|): R|ft<E, E?>|
public constructor(): R|test/RawOverrides.D|
public test/RawOverrides.constructor(): R|test/RawOverrides.D|
}
}
@@ -6,11 +6,11 @@ public/*package*/ open class AnnotatedParameterInInnerClassConstructor : R|kotli
}
public/*package*/ open inner class Inner : R|kotlin/Any| {
public/*package*/ constructor(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.Inner|
public/*package*/ test/AnnotatedParameterInInnerClassConstructor.constructor(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.Inner|
}
public/*package*/ open inner class InnerGeneric<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public/*package*/ constructor<T : R|ft<kotlin/Any, kotlin/Any?>|>(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.InnerGeneric<T>|
public/*package*/ test/AnnotatedParameterInInnerClassConstructor.constructor<T : R|ft<kotlin/Any, kotlin/Any?>|>(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.InnerGeneric<T>|
}
}
@@ -6,7 +6,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.BaseAnnotation|() public/*package*/ open inner class BaseClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.BaseClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.BaseClass|
}
@R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|()) public final annotation class BinaryAnnotation : R|kotlin/Annotation| {
@@ -14,7 +14,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.BinaryAnnotation|() public/*package*/ open inner class BinaryClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.BinaryClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.BinaryClass|
}
@R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.RUNTIME|()) public final annotation class RuntimeAnnotation : R|kotlin/Annotation| {
@@ -22,7 +22,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.RuntimeAnnotation|() public/*package*/ open inner class RuntimeClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.RuntimeClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.RuntimeClass|
}
@R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.SOURCE|()) public final annotation class SourceAnnotation : R|kotlin/Annotation| {
@@ -30,7 +30,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.SourceAnnotation|() public/*package*/ open inner class SourceClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.SourceClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.SourceClass|
}
}
@@ -2,23 +2,23 @@ public open class Rendering : R|kotlin/Any| {
public constructor(): R|test/Rendering|
public/*package*/ open inner class A_Plain : R|kotlin/Any| {
public/*package*/ constructor(): R|test/Rendering.A_Plain|
public/*package*/ test/Rendering.constructor(): R|test/Rendering.A_Plain|
}
public/*package*/ open inner class B_Super : R|kotlin/Any| {
public/*package*/ constructor(): R|test/Rendering.B_Super|
public/*package*/ test/Rendering.constructor(): R|test/Rendering.B_Super|
}
public/*package*/ open inner class C_Sub : R|test/Rendering.B_Super| {
public/*package*/ constructor(): R|test/Rendering.C_Sub|
public/*package*/ test/Rendering.constructor(): R|test/Rendering.C_Sub|
}
public/*package*/ open inner class D_SuperG<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public/*package*/ constructor<T : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/Rendering.D_SuperG<T>|
public/*package*/ test/Rendering.constructor<T : R|ft<kotlin/Any, kotlin/Any?>|>(): R|test/Rendering.D_SuperG<T>|
}
public/*package*/ open inner class E_SubG : R|test/Rendering.D_SuperG<ft<kotlin/String, kotlin/String?>>| {
public/*package*/ constructor(): R|test/Rendering.E_SubG|
public/*package*/ test/Rendering.constructor(): R|test/Rendering.E_SubG|
}
public/*package*/ abstract interface F_Array : R|kotlin/Any| {
@@ -4,7 +4,7 @@ public open class TypeParameterOfOuterClass<T : R|ft<kotlin/Any, kotlin/Any?>|>
public open inner class Inner<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public open fun foo(comparator: R|ft<java/util/Comparator<ft<T, T?>>, java/util/Comparator<ft<T, T?>>?>|): R|kotlin/Unit|
public constructor(): R|test/TypeParameterOfOuterClass.Inner<T>|
public test/TypeParameterOfOuterClass<T>.constructor(): R|test/TypeParameterOfOuterClass.Inner<T>|
}
}
@@ -6,7 +6,7 @@ public open class RawSuperType : R|kotlin/Any| {
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
public constructor(): R|test/RawSuperType.Derived|
public test/RawSuperType.constructor(): R|test/RawSuperType.Derived|
}
public abstract interface Super<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
@@ -10,7 +10,7 @@ public open class RawSuperTypeWithBound : R|kotlin/Any| {
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
public constructor(): R|test/RawSuperTypeWithBound.Derived|
public test/RawSuperTypeWithBound.constructor(): R|test/RawSuperTypeWithBound.Derived|
}
public abstract interface Super<T : R|ft<test/RawSuperTypeWithBound.Bound, test/RawSuperTypeWithBound.Bound?>|> : R|kotlin/Any| {
@@ -8,7 +8,7 @@ public open class RawSuperTypeWithRecursiveBound : R|kotlin/Any| {
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
public constructor(): R|test/RawSuperTypeWithRecursiveBound.Derived|
public test/RawSuperTypeWithRecursiveBound.constructor(): R|test/RawSuperTypeWithRecursiveBound.Derived|
}
public abstract interface Super<T : R|ft<test/RawSuperTypeWithRecursiveBound.Super<ft<T, T?>>, test/RawSuperTypeWithRecursiveBound.Super<ft<T, T?>>?>|> : R|kotlin/Any| {
@@ -8,7 +8,7 @@ public open class RawSuperTypeWithRecursiveBoundMultipleParameters : R|kotlin/An
@R|java/lang/Override|() public open fun dummy(): R|kotlin/Unit|
public constructor(): R|test/RawSuperTypeWithRecursiveBoundMultipleParameters.Derived|
public test/RawSuperTypeWithRecursiveBoundMultipleParameters.constructor(): R|test/RawSuperTypeWithRecursiveBoundMultipleParameters.Derived|
}
public abstract interface Super<R : R|ft<kotlin/Any, kotlin/Any?>|, T : R|ft<test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<ft<R, R?>, ft<T, T?>>, test/RawSuperTypeWithRecursiveBoundMultipleParameters.Super<ft<R, R?>, ft<T, T?>>?>|> : R|kotlin/Any| {
@@ -5,7 +5,7 @@ public abstract interface ReturnInnerSubclassOfSupersInner : R|kotlin/Any| {
public/*package*/ open inner class Inner<B : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/ReturnInnerSubclassOfSupersInner.Super.Inner<ft<B, B?>>| {
public/*package*/ open operator fun get(): R|ft<test/ReturnInnerSubclassOfSupersInner.Sub<ft<B, B?>>, test/ReturnInnerSubclassOfSupersInner.Sub<ft<B, B?>>?>|
public/*package*/ constructor(): R|test/ReturnInnerSubclassOfSupersInner.Sub.Inner<B>|
public/*package*/ test/ReturnInnerSubclassOfSupersInner.Sub<B>.constructor(): R|test/ReturnInnerSubclassOfSupersInner.Sub.Inner<B>|
}
}
@@ -15,7 +15,7 @@ public abstract interface ReturnInnerSubclassOfSupersInner : R|kotlin/Any| {
public/*package*/ open inner class Inner<A : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public/*package*/ open operator fun get(): R|ft<test/ReturnInnerSubclassOfSupersInner.Super<ft<A, A?>>, test/ReturnInnerSubclassOfSupersInner.Super<ft<A, A?>>?>|
public/*package*/ constructor(): R|test/ReturnInnerSubclassOfSupersInner.Super.Inner<A>|
public/*package*/ test/ReturnInnerSubclassOfSupersInner.Super<A>.constructor(): R|test/ReturnInnerSubclassOfSupersInner.Super.Inner<A>|
}
}
@@ -4,17 +4,17 @@ public open class DeeplyInnerClass : R|kotlin/Any| {
public/*package*/ open inner class A : R|kotlin/Any| {
public/*package*/ open fun a(): R|kotlin/Unit|
public/*package*/ constructor(): R|test/DeeplyInnerClass.A|
public/*package*/ test/DeeplyInnerClass.constructor(): R|test/DeeplyInnerClass.A|
public/*package*/ open inner class B : R|kotlin/Any| {
public/*package*/ open fun b(): R|kotlin/Unit|
public/*package*/ constructor(): R|test/DeeplyInnerClass.A.B|
public/*package*/ test/DeeplyInnerClass.A.constructor(): R|test/DeeplyInnerClass.A.B|
public/*package*/ open inner class C : R|kotlin/Any| {
public/*package*/ open fun c(): R|kotlin/Unit|
public/*package*/ constructor(): R|test/DeeplyInnerClass.A.B.C|
public/*package*/ test/DeeplyInnerClass.A.B.constructor(): R|test/DeeplyInnerClass.A.B.C|
}
}
@@ -13,7 +13,7 @@ public final enum class Enum : R|kotlin/Enum<ft<test/Enum, test/Enum?>>| {
public/*package*/ open fun valueOf(s: R|ft<kotlin/String, kotlin/String?>|): R|kotlin/Unit|
public constructor(): R|test/Enum.Inner|
public test/Enum.constructor(): R|test/Enum.Inner|
}
public open class Nested : R|kotlin/Any| {
@@ -4,7 +4,7 @@ public open class InnerClass : R|kotlin/Any| {
public open inner class Inner : R|kotlin/Any| {
public open fun foo(): R|kotlin/Unit|
public constructor(): R|test/InnerClass.Inner|
public test/InnerClass.constructor(): R|test/InnerClass.Inner|
}
public open class Nested : R|kotlin/Any| {