Resolve local declaration statuses & types inside bodies in FirBodyResolveTransformer
This commit is contained in:
@@ -424,9 +424,8 @@ class Fir2IrVisitor(
|
||||
val constructedIrType = constructedTypeRef.toIrType(this@Fir2IrVisitor.session, declarationStorage)
|
||||
// TODO: find delegated constructor correctly
|
||||
val classId = constructedClassSymbol.classId
|
||||
val provider = this@Fir2IrVisitor.session.firSymbolProvider
|
||||
var constructorSymbol: FirConstructorSymbol? = null
|
||||
provider.getClassUseSiteMemberScope(classId, this@Fir2IrVisitor.session, ScopeSession())!!.processFunctionsByName(
|
||||
constructedClassSymbol.buildUseSiteMemberScope(this@Fir2IrVisitor.session, ScopeSession())!!.processFunctionsByName(
|
||||
classId.shortClassName
|
||||
) {
|
||||
when {
|
||||
|
||||
@@ -88,4 +88,9 @@ class FirJavaClass internal constructor(
|
||||
superTypeRefs.transformInplace(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirJavaClass {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,5 +102,14 @@ class FirJavaConstructor(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirJavaConstructor {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirJavaConstructor {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override var containerSource: DeserializedContainerSource? = null
|
||||
}
|
||||
@@ -72,6 +72,10 @@ class FirJavaField(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirField {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
@@ -88,6 +92,11 @@ class FirJavaField(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirJavaField {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override val delegate: FirExpression?
|
||||
get() = null
|
||||
|
||||
|
||||
+18
-16
@@ -467,24 +467,26 @@ class DeclarationsConverter(
|
||||
superTypeRefs.ifEmpty { superTypeRefs += implicitAnyType }
|
||||
val delegatedType = delegatedSuperTypeRef ?: implicitAnyType
|
||||
|
||||
return FirAnonymousObjectImpl(null, session, FirAnonymousObjectSymbol()).apply {
|
||||
annotations += modifiers.annotations
|
||||
this.superTypeRefs += superTypeRefs
|
||||
this.typeRef = superTypeRefs.first()
|
||||
return withChildClassName(ANONYMOUS_OBJECT_NAME) {
|
||||
FirAnonymousObjectImpl(null, session, FirAnonymousObjectSymbol()).apply {
|
||||
annotations += modifiers.annotations
|
||||
this.superTypeRefs += superTypeRefs
|
||||
this.typeRef = superTypeRefs.first()
|
||||
|
||||
val classWrapper = ClassWrapper(
|
||||
SpecialNames.NO_NAME_PROVIDED, modifiers, ClassKind.OBJECT, hasPrimaryConstructor = false,
|
||||
hasSecondaryConstructor = classBody.getChildNodesByType(SECONDARY_CONSTRUCTOR).isNotEmpty(),
|
||||
delegatedSelfTypeRef = delegatedType,
|
||||
delegatedSuperTypeRef = delegatedType,
|
||||
superTypeCallEntry = superTypeCallEntry
|
||||
)
|
||||
//parse primary constructor
|
||||
convertPrimaryConstructor(primaryConstructor, classWrapper)?.let { this.declarations += it.firConstructor }
|
||||
val classWrapper = ClassWrapper(
|
||||
SpecialNames.NO_NAME_PROVIDED, modifiers, ClassKind.OBJECT, hasPrimaryConstructor = false,
|
||||
hasSecondaryConstructor = classBody.getChildNodesByType(SECONDARY_CONSTRUCTOR).isNotEmpty(),
|
||||
delegatedSelfTypeRef = delegatedType,
|
||||
delegatedSuperTypeRef = delegatedType,
|
||||
superTypeCallEntry = superTypeCallEntry
|
||||
)
|
||||
//parse primary constructor
|
||||
convertPrimaryConstructor(primaryConstructor, classWrapper)?.let { this.declarations += it.firConstructor }
|
||||
|
||||
//parse declarations
|
||||
classBody?.let {
|
||||
this.declarations += convertClassBody(it, classWrapper)
|
||||
//parse declarations
|
||||
classBody?.let {
|
||||
this.declarations += convertClassBody(it, classWrapper)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ abstract class BaseFirBuilder<T>(val session: FirSession, val context: Context =
|
||||
when {
|
||||
local -> CallableId(name)
|
||||
context.className == FqName.ROOT -> CallableId(context.packageFqName, name)
|
||||
context.className.shortName() === ANONYMOUS_OBJECT_NAME -> CallableId(FqName.ROOT, FqName("anonymous"), name)
|
||||
else -> CallableId(context.packageFqName, context.className, name)
|
||||
}
|
||||
|
||||
@@ -94,6 +95,8 @@ abstract class BaseFirBuilder<T>(val session: FirSession, val context: Context =
|
||||
/**** Common utils ****/
|
||||
companion object {
|
||||
val KNPE = Name.identifier("KotlinNullPointerException")
|
||||
|
||||
val ANONYMOUS_OBJECT_NAME = Name.special("<anonymous>")
|
||||
}
|
||||
|
||||
fun FirExpression.toReturn(baseSource: FirSourceElement? = source, labelName: String? = null): FirReturnExpression {
|
||||
|
||||
@@ -541,16 +541,18 @@ class RawFirBuilder(session: FirSession, val stubMode: Boolean) : BaseFirBuilder
|
||||
|
||||
override fun visitObjectLiteralExpression(expression: KtObjectLiteralExpression, data: Unit): FirElement {
|
||||
val objectDeclaration = expression.objectDeclaration
|
||||
return FirAnonymousObjectImpl(expression.toFirSourceElement(), session, FirAnonymousObjectSymbol()).apply {
|
||||
objectDeclaration.extractAnnotationsTo(this)
|
||||
objectDeclaration.extractSuperTypeListEntriesTo(this, null)
|
||||
this.typeRef = superTypeRefs.first() // TODO
|
||||
return withChildClassName(ANONYMOUS_OBJECT_NAME) {
|
||||
FirAnonymousObjectImpl(expression.toFirSourceElement(), session, FirAnonymousObjectSymbol()).apply {
|
||||
objectDeclaration.extractAnnotationsTo(this)
|
||||
objectDeclaration.extractSuperTypeListEntriesTo(this, null)
|
||||
this.typeRef = superTypeRefs.first() // TODO
|
||||
|
||||
for (declaration in objectDeclaration.declarations) {
|
||||
declarations += declaration.toFirDeclaration(
|
||||
delegatedSuperType = null, delegatedSelfType = null,
|
||||
owner = objectDeclaration, hasPrimaryConstructor = false
|
||||
)
|
||||
for (declaration in objectDeclaration.declarations) {
|
||||
declarations += declaration.toFirDeclaration(
|
||||
delegatedSuperType = null, delegatedSelfType = null,
|
||||
owner = objectDeclaration, hasPrimaryConstructor = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,23 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.resolve
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationStatus
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
|
||||
sealed class ResolutionMode {
|
||||
object ContextDependent : ResolutionMode()
|
||||
object ContextIndependent : ResolutionMode()
|
||||
// TODO: it's better not to use WithExpectedType(FirImplicitTypeRef)
|
||||
class WithExpectedType(val expectedTypeRef: FirTypeRef) : ResolutionMode()
|
||||
|
||||
class WithStatus(val status: FirDeclarationStatus) : ResolutionMode()
|
||||
|
||||
class LambdaResolution(val expectedReturnTypeRef: FirResolvedTypeRef?) : ResolutionMode()
|
||||
}
|
||||
|
||||
fun withExpectedType(expectedTypeRef: FirTypeRef?): ResolutionMode =
|
||||
expectedTypeRef?.let { ResolutionMode.WithExpectedType(it) } ?: ResolutionMode.ContextDependent
|
||||
expectedTypeRef?.let { ResolutionMode.WithExpectedType(it) } ?: ResolutionMode.ContextDependent
|
||||
|
||||
fun FirDeclarationStatus.mode(): ResolutionMode =
|
||||
ResolutionMode.WithStatus(this)
|
||||
+2
-2
@@ -10,8 +10,8 @@ import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
import org.jetbrains.kotlin.fir.visitors.compose
|
||||
|
||||
abstract class FirAbstractTreeTransformer(phase: FirResolvePhase) : FirAbstractPhaseTransformer<Nothing?>(phase) {
|
||||
override fun <E : FirElement> transformElement(element: E, data: Nothing?): CompositeTransformResult<E> {
|
||||
abstract class FirAbstractTreeTransformer<D>(phase: FirResolvePhase) : FirAbstractPhaseTransformer<D>(phase) {
|
||||
override fun <E : FirElement> transformElement(element: E, data: D): CompositeTransformResult<E> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return (element.transformChildren(this, data) as E).compose()
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
abstract class FirAbstractTreeTransformerWithSuperTypes(
|
||||
phase: FirResolvePhase,
|
||||
reversedScopePriority: Boolean
|
||||
) : FirAbstractTreeTransformer(phase) {
|
||||
) : FirAbstractTreeTransformer<Nothing?>(phase) {
|
||||
protected val towerScope = FirCompositeScope(mutableListOf(), reversedPriority = reversedScopePriority)
|
||||
|
||||
protected inline fun <T> withScopeCleanup(crossinline l: () -> T): T {
|
||||
|
||||
+11
-2
@@ -8,9 +8,11 @@ package org.jetbrains.kotlin.fir.resolve.transformers
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.copy
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.references.impl.FirResolvedCallableReferenceImpl
|
||||
import org.jetbrains.kotlin.fir.references.impl.FirResolvedNamedReferenceImpl
|
||||
import org.jetbrains.kotlin.fir.render
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.Candidate
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.candidate
|
||||
@@ -22,6 +24,7 @@ import org.jetbrains.kotlin.fir.resolve.withNullability
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.withReplacedConeType
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirErrorTypeRefImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeRefImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirTypeProjectionWithVarianceImpl
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
@@ -32,7 +35,7 @@ class FirCallCompletionResultsWriterTransformer(
|
||||
override val session: FirSession,
|
||||
private val finalSubstitutor: ConeSubstitutor,
|
||||
private val typeCalculator: ReturnTypeCalculator
|
||||
) : FirAbstractTreeTransformer(phase = FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) {
|
||||
) : FirAbstractTreeTransformer<Nothing?>(phase = FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) {
|
||||
|
||||
override fun transformQualifiedAccessExpression(
|
||||
qualifiedAccessExpression: FirQualifiedAccessExpression,
|
||||
@@ -42,7 +45,13 @@ class FirCallCompletionResultsWriterTransformer(
|
||||
qualifiedAccessExpression.calleeReference as? FirNamedReferenceWithCandidate ?: return qualifiedAccessExpression.compose()
|
||||
calleeReference.candidate.substitutor
|
||||
|
||||
val typeRef = typeCalculator.tryCalculateReturnType(calleeReference.candidateSymbol.phasedFir as FirTypedDeclaration)
|
||||
val candidateFir = calleeReference.candidateSymbol.phasedFir
|
||||
val typeRef = (candidateFir as? FirTypedDeclaration)?.let {
|
||||
typeCalculator.tryCalculateReturnType(it)
|
||||
} ?: FirErrorTypeRefImpl(
|
||||
calleeReference.source,
|
||||
FirSimpleDiagnostic("Callee reference to candidate without return type: ${candidateFir.render()}")
|
||||
)
|
||||
|
||||
val initialType = calleeReference.candidate.substitutor.substituteOrNull(typeRef.type)
|
||||
val finalType = finalSubstitutor.substituteOrNull(initialType)
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.fir.visitors.compose
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
class FirImportResolveTransformer() : FirAbstractTreeTransformer(phase = FirResolvePhase.IMPORTS) {
|
||||
class FirImportResolveTransformer() : FirAbstractTreeTransformer<Nothing?>(phase = FirResolvePhase.IMPORTS) {
|
||||
override fun <E : FirElement> transformElement(element: E, data: Nothing?): CompositeTransformResult<E> {
|
||||
return element.compose()
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import org.jetbrains.kotlin.fir.visitors.compose
|
||||
class FirSpecificTypeResolverTransformer(
|
||||
private val towerScope: FirScope,
|
||||
override val session: FirSession
|
||||
) : FirAbstractTreeTransformer(phase = FirResolvePhase.SUPER_TYPES) {
|
||||
) : FirAbstractTreeTransformer<Nothing?>(phase = FirResolvePhase.SUPER_TYPES) {
|
||||
override fun transformTypeRef(typeRef: FirTypeRef, data: Nothing?): CompositeTransformResult<FirTypeRef> {
|
||||
val typeResolver = FirTypeResolver.getInstance(session)
|
||||
typeRef.transformChildren(FirSpecificTypeResolverTransformer(towerScope, session), null)
|
||||
|
||||
+91
-97
@@ -17,83 +17,23 @@ import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
import org.jetbrains.kotlin.fir.visitors.compose
|
||||
|
||||
class FirStatusResolveTransformer : FirAbstractTreeTransformer(phase = FirResolvePhase.STATUS) {
|
||||
private val declarationsWithStatuses = mutableListOf<FirDeclaration>()
|
||||
|
||||
class FirStatusResolveTransformer : FirAbstractTreeTransformer<FirDeclarationStatus?>(phase = FirResolvePhase.STATUS) {
|
||||
private val classes = mutableListOf<FirRegularClass>()
|
||||
|
||||
private fun FirDeclaration.resolveVisibility(): Visibility {
|
||||
if (this is FirConstructor) {
|
||||
val klass = classes.lastOrNull()
|
||||
if (klass != null && (klass.classKind == ClassKind.ENUM_CLASS || klass.modality == Modality.SEALED)) {
|
||||
return Visibilities.PRIVATE
|
||||
}
|
||||
}
|
||||
return Visibilities.PUBLIC // TODO (overrides)
|
||||
}
|
||||
|
||||
private fun FirDeclaration.resolveModality(): Modality {
|
||||
return when (this) {
|
||||
is FirEnumEntry -> Modality.FINAL
|
||||
is FirRegularClass -> if (classKind == ClassKind.INTERFACE) Modality.ABSTRACT else Modality.FINAL
|
||||
is FirCallableMemberDeclaration<*> -> {
|
||||
val containingClass = classes.lastOrNull()
|
||||
when {
|
||||
containingClass == null -> Modality.FINAL
|
||||
containingClass.classKind == ClassKind.INTERFACE -> {
|
||||
when {
|
||||
visibility == Visibilities.PRIVATE ->
|
||||
Modality.FINAL
|
||||
this is FirSimpleFunction && body == null ->
|
||||
Modality.ABSTRACT
|
||||
this is FirProperty && initializer == null && getter?.body == null && setter?.body == null ->
|
||||
Modality.ABSTRACT
|
||||
else ->
|
||||
Modality.OPEN
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
if (isOverride && containingClass.modality != Modality.FINAL) Modality.OPEN else Modality.FINAL
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> Modality.FINAL
|
||||
}
|
||||
}
|
||||
private val containingClass: FirRegularClass? get() = classes.lastOrNull()
|
||||
|
||||
override lateinit var session: FirSession
|
||||
|
||||
override fun transformFile(file: FirFile, data: Nothing?): CompositeTransformResult<FirFile> {
|
||||
override fun transformFile(file: FirFile, data: FirDeclarationStatus?): CompositeTransformResult<FirFile> {
|
||||
session = file.session
|
||||
return transformElement(file, data)
|
||||
}
|
||||
|
||||
override fun transformDeclarationStatus(
|
||||
declarationStatus: FirDeclarationStatus,
|
||||
data: Nothing?
|
||||
data: FirDeclarationStatus?
|
||||
): CompositeTransformResult<FirDeclarationStatus> {
|
||||
if (declarationStatus.visibility == Visibilities.UNKNOWN || declarationStatus.modality == null) {
|
||||
val declaration = declarationsWithStatuses.last()
|
||||
val visibility = when (declarationStatus.visibility) {
|
||||
Visibilities.UNKNOWN -> declaration.resolveVisibility()
|
||||
else -> declarationStatus.visibility
|
||||
}
|
||||
val modality = declarationStatus.modality ?: declaration.resolveModality()
|
||||
val resolvedStatus = (declarationStatus as FirDeclarationStatusImpl).resolved(visibility, modality)
|
||||
return resolvedStatus.compose()
|
||||
}
|
||||
|
||||
return transformElement(declarationStatus, data)
|
||||
}
|
||||
|
||||
private inline fun storeDeclaration(
|
||||
declaration: FirDeclaration,
|
||||
computeResult: () -> CompositeTransformResult<FirDeclaration>
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
declarationsWithStatuses += declaration
|
||||
val result = computeResult()
|
||||
declarationsWithStatuses.removeAt(declarationsWithStatuses.lastIndex)
|
||||
return result
|
||||
return (data ?: declarationStatus).compose()
|
||||
}
|
||||
|
||||
private inline fun storeClass(
|
||||
@@ -106,63 +46,117 @@ class FirStatusResolveTransformer : FirAbstractTreeTransformer(phase = FirResolv
|
||||
return result
|
||||
}
|
||||
|
||||
override fun transformTypeAlias(typeAlias: FirTypeAlias, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
return transformMemberDeclaration(typeAlias, data)
|
||||
override fun transformTypeAlias(typeAlias: FirTypeAlias, data: FirDeclarationStatus?): CompositeTransformResult<FirDeclaration> {
|
||||
typeAlias.typeParameters.forEach { transformDeclaration(it, data) }
|
||||
typeAlias.transformStatus(this, typeAlias.resolveStatus(typeAlias.status, containingClass, isLocal = false))
|
||||
return typeAlias.compose()
|
||||
}
|
||||
|
||||
override fun transformRegularClass(regularClass: FirRegularClass, data: Nothing?): CompositeTransformResult<FirStatement> {
|
||||
override fun transformRegularClass(regularClass: FirRegularClass, data: FirDeclarationStatus?): CompositeTransformResult<FirStatement> {
|
||||
regularClass.transformStatus(this, regularClass.resolveStatus(regularClass.status, containingClass, isLocal = false))
|
||||
return storeClass(regularClass) {
|
||||
transformMemberDeclaration(regularClass, data)
|
||||
regularClass.typeParameters.forEach { transformDeclaration(it, data) }
|
||||
transformDeclaration(regularClass, data)
|
||||
} as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
|
||||
override fun transformMemberDeclaration(
|
||||
memberDeclaration: FirMemberDeclaration,
|
||||
data: Nothing?
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
return storeDeclaration(memberDeclaration) {
|
||||
transformDeclaration(memberDeclaration, data)
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformPropertyAccessor(
|
||||
propertyAccessor: FirPropertyAccessor,
|
||||
data: Nothing?
|
||||
data: FirDeclarationStatus?
|
||||
): CompositeTransformResult<FirStatement> {
|
||||
return storeDeclaration(propertyAccessor) {
|
||||
transformDeclaration(propertyAccessor, data)
|
||||
} as CompositeTransformResult<FirStatement>
|
||||
propertyAccessor.transformStatus(this, propertyAccessor.resolveStatus(propertyAccessor.status, containingClass, isLocal = false))
|
||||
return transformDeclaration(propertyAccessor, data) as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
|
||||
override fun transformConstructor(
|
||||
constructor: FirConstructor,
|
||||
data: Nothing?
|
||||
data: FirDeclarationStatus?
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
return storeDeclaration(constructor) {
|
||||
transformDeclaration(constructor, data)
|
||||
}
|
||||
constructor.transformStatus(this, constructor.resolveStatus(constructor.status, containingClass, isLocal = false))
|
||||
return transformDeclaration(constructor, data)
|
||||
}
|
||||
|
||||
override fun transformSimpleFunction(simpleFunction: FirSimpleFunction, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||
return storeDeclaration(simpleFunction) {
|
||||
transformDeclaration(simpleFunction, data)
|
||||
}
|
||||
override fun transformSimpleFunction(
|
||||
simpleFunction: FirSimpleFunction,
|
||||
data: FirDeclarationStatus?
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
simpleFunction.transformStatus(this, simpleFunction.resolveStatus(simpleFunction.status, containingClass, isLocal = false))
|
||||
return transformDeclaration(simpleFunction, data)
|
||||
}
|
||||
|
||||
override fun transformProperty(
|
||||
property: FirProperty,
|
||||
data: Nothing?
|
||||
data: FirDeclarationStatus?
|
||||
): CompositeTransformResult<FirDeclaration> {
|
||||
return storeDeclaration(property) {
|
||||
transformDeclaration(property, data)
|
||||
}
|
||||
property.transformStatus(this, property.resolveStatus(property.status, containingClass, isLocal = false))
|
||||
return transformDeclaration(property, data)
|
||||
}
|
||||
|
||||
override fun transformValueParameter(valueParameter: FirValueParameter, data: Nothing?): CompositeTransformResult<FirStatement> {
|
||||
return (transformDeclaration(valueParameter, data).single as FirStatement).compose()
|
||||
override fun transformValueParameter(
|
||||
valueParameter: FirValueParameter,
|
||||
data: FirDeclarationStatus?
|
||||
): CompositeTransformResult<FirStatement> {
|
||||
return transformDeclaration(valueParameter, data) as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
|
||||
override fun transformBlock(block: FirBlock, data: Nothing?): CompositeTransformResult<FirStatement> {
|
||||
override fun transformBlock(block: FirBlock, data: FirDeclarationStatus?): CompositeTransformResult<FirStatement> {
|
||||
return block.compose()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun FirDeclaration.resolveStatus(
|
||||
status: FirDeclarationStatus,
|
||||
containingClass: FirRegularClass?,
|
||||
isLocal: Boolean
|
||||
): FirDeclarationStatus {
|
||||
if (status.visibility == Visibilities.UNKNOWN || status.modality == null) {
|
||||
val visibility = when (status.visibility) {
|
||||
Visibilities.UNKNOWN -> if (isLocal) Visibilities.LOCAL else resolveVisibility(containingClass)
|
||||
else -> status.visibility
|
||||
}
|
||||
val modality = status.modality ?: resolveModality(containingClass)
|
||||
return (status as FirDeclarationStatusImpl).resolved(visibility, modality)
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
private fun FirDeclaration.resolveVisibility(containingClass: FirRegularClass?): Visibility {
|
||||
if (this is FirConstructor) {
|
||||
if (containingClass != null &&
|
||||
(containingClass.classKind == ClassKind.ENUM_CLASS || containingClass.modality == Modality.SEALED)
|
||||
) {
|
||||
return Visibilities.PRIVATE
|
||||
}
|
||||
}
|
||||
return Visibilities.PUBLIC // TODO (overrides)
|
||||
}
|
||||
|
||||
private fun FirDeclaration.resolveModality(containingClass: FirRegularClass?): Modality {
|
||||
return when (this) {
|
||||
is FirEnumEntry -> Modality.FINAL
|
||||
is FirRegularClass -> if (classKind == ClassKind.INTERFACE) Modality.ABSTRACT else Modality.FINAL
|
||||
is FirCallableMemberDeclaration<*> -> {
|
||||
when {
|
||||
containingClass == null -> Modality.FINAL
|
||||
containingClass.classKind == ClassKind.INTERFACE -> {
|
||||
when {
|
||||
visibility == Visibilities.PRIVATE ->
|
||||
Modality.FINAL
|
||||
this is FirSimpleFunction && body == null ->
|
||||
Modality.ABSTRACT
|
||||
this is FirProperty && initializer == null && getter?.body == null && setter?.body == null ->
|
||||
Modality.ABSTRACT
|
||||
else ->
|
||||
Modality.OPEN
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
if (isOverride && containingClass.modality != Modality.FINAL) Modality.OPEN else Modality.FINAL
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> Modality.FINAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
import org.jetbrains.kotlin.fir.visitors.compose
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
class FirSupertypeResolverTransformer : FirAbstractTreeTransformer(phase = FirResolvePhase.SUPER_TYPES) {
|
||||
class FirSupertypeResolverTransformer : FirAbstractTreeTransformer<Nothing?>(phase = FirResolvePhase.SUPER_TYPES) {
|
||||
override lateinit var session: FirSession
|
||||
private lateinit var file: FirFile
|
||||
|
||||
|
||||
+1
-11
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.fir.expressions.FirBlock
|
||||
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||
import org.jetbrains.kotlin.fir.resolve.*
|
||||
import org.jetbrains.kotlin.fir.scopes.addImportingScopes
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.withReplacedConeType
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirImplicitBuiltinTypeRef
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
@@ -83,16 +82,7 @@ open class FirTypeResolveTransformer : FirAbstractTreeTransformerWithSuperTypes(
|
||||
|
||||
override fun transformValueParameter(valueParameter: FirValueParameter, data: Nothing?): CompositeTransformResult<FirStatement> {
|
||||
val result = transformDeclaration(valueParameter, data).single as FirValueParameter
|
||||
if (result.isVararg) {
|
||||
val returnTypeRef = result.returnTypeRef
|
||||
val returnType = returnTypeRef.coneTypeUnsafe<ConeKotlinType>()
|
||||
result.transformReturnTypeRef(
|
||||
StoreType,
|
||||
result.returnTypeRef.withReplacedConeType(
|
||||
returnType.createArrayOf(session)
|
||||
)
|
||||
)
|
||||
}
|
||||
result.transformVarargTypeToArrayType()
|
||||
return result.compose()
|
||||
}
|
||||
|
||||
|
||||
+13
-2
@@ -6,14 +6,15 @@
|
||||
package org.jetbrains.kotlin.fir.resolve.transformers
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirFunctionCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression
|
||||
import org.jetbrains.kotlin.fir.references.FirNamedReference
|
||||
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.withReplacedConeType
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
import org.jetbrains.kotlin.fir.visitors.FirDefaultTransformer
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
@@ -102,3 +103,13 @@ internal object StoreReceiver : FirTransformer<FirExpression>() {
|
||||
return (data as E).compose()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun FirValueParameter.transformVarargTypeToArrayType() {
|
||||
if (isVararg) {
|
||||
val returnType = returnTypeRef.coneTypeUnsafe<ConeKotlinType>()
|
||||
transformReturnTypeRef(
|
||||
StoreType,
|
||||
returnTypeRef.withReplacedConeType(returnType.createArrayOf(session))
|
||||
)
|
||||
}
|
||||
}
|
||||
+13
-6
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.resolve.inference.FirCallCompleter
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.*
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirLocalScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirTypeResolveScopeForBodyResolve
|
||||
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImpl
|
||||
@@ -73,6 +74,7 @@ abstract class FirAbstractBodyResolveTransformer(phase: FirResolvePhase) : FirAb
|
||||
protected inline val inferenceComponents: InferenceComponents get() = components.inferenceComponents
|
||||
protected inline val resolutionStageRunner: ResolutionStageRunner get() = components.resolutionStageRunner
|
||||
protected inline val samResolver: FirSamResolver get() = components.samResolver
|
||||
protected inline val typeResolverTransformer: FirSpecificTypeResolverTransformer get() = components.typeResolverTransformer
|
||||
protected inline val callCompleter: FirCallCompleter get() = components.callCompleter
|
||||
protected inline val dataFlowAnalyzer: FirDataFlowAnalyzer get() = components.dataFlowAnalyzer
|
||||
protected inline val scopeSession: ScopeSession get() = components.scopeSession
|
||||
@@ -114,22 +116,27 @@ abstract class FirAbstractBodyResolveTransformer(phase: FirResolvePhase) : FirAb
|
||||
implicitReceiverStack,
|
||||
qualifiedResolver
|
||||
)
|
||||
val typeResolverTransformer = FirSpecificTypeResolverTransformer(
|
||||
FirTypeResolveScopeForBodyResolve(topLevelScopes, localScopes), session
|
||||
)
|
||||
val callCompleter: FirCallCompleter = FirCallCompleter(transformer, this)
|
||||
val dataFlowAnalyzer: FirDataFlowAnalyzer = FirDataFlowAnalyzer(this)
|
||||
override val syntheticCallGenerator: FirSyntheticCallGenerator = FirSyntheticCallGenerator(this, callCompleter)
|
||||
|
||||
internal var _container: FirDeclaration? = null
|
||||
internal var containerIfAny: FirDeclaration? = null
|
||||
private set
|
||||
|
||||
override var container: FirDeclaration
|
||||
get() = _container!!
|
||||
get() = containerIfAny!!
|
||||
private set(value) {
|
||||
_container = value
|
||||
containerIfAny = value
|
||||
}
|
||||
|
||||
internal inline fun <T> withContainer(declaration: FirDeclaration, crossinline f: () -> T): T {
|
||||
val prevContainer = _container
|
||||
_container = declaration
|
||||
val prevContainer = containerIfAny
|
||||
containerIfAny = declaration
|
||||
val result = f()
|
||||
_container = prevContainer
|
||||
containerIfAny = prevContainer
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
+12
-1
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.resolve.ResolutionMode
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.scopes.addImportingScopes
|
||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
||||
@@ -51,7 +52,10 @@ open class FirBodyResolveTransformer(
|
||||
}
|
||||
|
||||
override fun transformTypeRef(typeRef: FirTypeRef, data: ResolutionMode): CompositeTransformResult<FirTypeRef> {
|
||||
return typeRef.compose()
|
||||
if (typeRef is FirResolvedTypeRef) {
|
||||
return typeRef.compose()
|
||||
}
|
||||
return typeResolverTransformer.transformTypeRef(typeRef, null)
|
||||
}
|
||||
|
||||
override fun transformImplicitTypeRef(implicitTypeRef: FirImplicitTypeRef, data: ResolutionMode): CompositeTransformResult<FirTypeRef> {
|
||||
@@ -142,6 +146,13 @@ open class FirBodyResolveTransformer(
|
||||
return declarationsTransformer.transformDeclaration(declaration, data)
|
||||
}
|
||||
|
||||
override fun transformDeclarationStatus(
|
||||
declarationStatus: FirDeclarationStatus,
|
||||
data: ResolutionMode
|
||||
): CompositeTransformResult<FirDeclarationStatus> {
|
||||
return declarationsTransformer.transformDeclarationStatus(declarationStatus, data)
|
||||
}
|
||||
|
||||
override fun transformProperty(property: FirProperty, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
return declarationsTransformer.transformProperty(property, data)
|
||||
}
|
||||
|
||||
+1
@@ -155,6 +155,7 @@ class FirControlFlowStatementsResolveTransformer(transformer: FirBodyResolveTran
|
||||
|
||||
override fun transformCatch(catch: FirCatch, data: ResolutionMode): CompositeTransformResult<FirCatch> {
|
||||
dataFlowAnalyzer.enterCatchClause(catch)
|
||||
catch.parameter.transformReturnTypeRef(transformer, ResolutionMode.ContextIndependent)
|
||||
return withScopeCleanup(localScopes) {
|
||||
localScopes += FirLocalScope()
|
||||
catch.transformParameter(transformer, ResolutionMode.ContextIndependent)
|
||||
|
||||
+193
-65
@@ -13,17 +13,18 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirValueParameterImpl
|
||||
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
|
||||
import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic
|
||||
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||
import org.jetbrains.kotlin.fir.resolve.ResolutionMode
|
||||
import org.jetbrains.kotlin.fir.resolve.*
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.ImplicitDispatchReceiverValue
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.ImplicitExtensionReceiverValue
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.extractLambdaInfoFromFunctionalType
|
||||
import org.jetbrains.kotlin.fir.resolve.constructFunctionalTypeRef
|
||||
import org.jetbrains.kotlin.fir.resolve.defaultType
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.ControlFlowGraphReferenceTransformer
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.FirStatusResolveTransformer.Companion.resolveStatus
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.StoreType
|
||||
import org.jetbrains.kotlin.fir.resolve.withExpectedType
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.transformVarargTypeToArrayType
|
||||
import org.jetbrains.kotlin.fir.resolvedTypeFromPrototype
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirLocalScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirMemberTypeParameterScope
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.nestedClassifierScope
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.FirComputingImplicitTypeRef
|
||||
@@ -38,6 +39,8 @@ import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer) : FirPartialBodyResolveTransformer(transformer) {
|
||||
private var primaryConstructorParametersScope: FirLocalScope? = null
|
||||
|
||||
private var containingClass: FirRegularClass? = null
|
||||
|
||||
override fun transformDeclaration(declaration: FirDeclaration, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
return components.withContainer(declaration) {
|
||||
declaration.replaceResolvePhase(transformerPhase)
|
||||
@@ -45,39 +48,77 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformProperty(property: FirProperty, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
if (property.isLocal) return transformLocalVariable(property, data)
|
||||
val returnTypeRef = property.returnTypeRef
|
||||
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return property.compose()
|
||||
if (property.resolvePhase == transformerPhase) return property.compose()
|
||||
dataFlowAnalyzer.enterProperty(property)
|
||||
if (returnTypeRef is FirImplicitTypeRef) {
|
||||
property.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||
}
|
||||
return withFullBodyResolve {
|
||||
withScopeCleanup(localScopes) {
|
||||
localScopes.addIfNotNull(primaryConstructorParametersScope)
|
||||
components.withContainer(property) {
|
||||
property.transformChildrenWithoutAccessors(returnTypeRef)
|
||||
if (property.initializer != null) {
|
||||
storeVariableReturnType(property)
|
||||
}
|
||||
withScopeCleanup(localScopes) {
|
||||
localScopes.add(FirLocalScope().apply {
|
||||
storeBackingField(property)
|
||||
})
|
||||
property.transformAccessors()
|
||||
}
|
||||
}
|
||||
property.replaceResolvePhase(transformerPhase)
|
||||
val controlFlowGraph = dataFlowAnalyzer.exitProperty(property)
|
||||
property.transformControlFlowGraphReference(ControlFlowGraphReferenceTransformer, controlFlowGraph)
|
||||
property.compose()
|
||||
override fun transformDeclarationStatus(
|
||||
declarationStatus: FirDeclarationStatus,
|
||||
data: ResolutionMode
|
||||
): CompositeTransformResult<FirDeclarationStatus> {
|
||||
return ((data as? ResolutionMode.WithStatus)?.status ?: declarationStatus).compose()
|
||||
}
|
||||
|
||||
private fun prepareTypeParameterOwnerForBodyResolve(declaration: FirMemberDeclaration) {
|
||||
if (declaration.typeParameters.isNotEmpty()) {
|
||||
topLevelScopes += FirMemberTypeParameterScope(declaration)
|
||||
for (typeParameter in declaration.typeParameters) {
|
||||
typeParameter.replaceResolvePhase(FirResolvePhase.STATUS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun transformLocalVariable(variable: FirProperty, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
private fun prepareSignatureForBodyResolve(callableMember: FirCallableMemberDeclaration<*>) {
|
||||
withScopeCleanup(topLevelScopes) {
|
||||
callableMember.transformReturnTypeRef(transformer, ResolutionMode.ContextIndependent)
|
||||
callableMember.transformReceiverTypeRef(transformer, ResolutionMode.ContextIndependent)
|
||||
if (callableMember is FirFunction<*>) {
|
||||
callableMember.valueParameters.forEach {
|
||||
it.transformReturnTypeRef(transformer, ResolutionMode.ContextIndependent)
|
||||
it.transformVarargTypeToArrayType()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformProperty(property: FirProperty, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
return withScopeCleanup(topLevelScopes) {
|
||||
prepareTypeParameterOwnerForBodyResolve(property)
|
||||
if (property.isLocal) {
|
||||
prepareSignatureForBodyResolve(property)
|
||||
property.transformStatus(this, property.resolveStatus(property.status).mode())
|
||||
property.getter?.let { it.transformStatus(this, it.resolveStatus(it.status).mode()) }
|
||||
property.setter?.let { it.transformStatus(this, it.resolveStatus(it.status).mode()) }
|
||||
return@withScopeCleanup transformLocalVariable(property)
|
||||
}
|
||||
val returnTypeRef = property.returnTypeRef
|
||||
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return@withScopeCleanup property.compose()
|
||||
if (property.resolvePhase == transformerPhase) return@withScopeCleanup property.compose()
|
||||
dataFlowAnalyzer.enterProperty(property)
|
||||
if (returnTypeRef is FirImplicitTypeRef) {
|
||||
property.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||
}
|
||||
withFullBodyResolve {
|
||||
withScopeCleanup(localScopes) {
|
||||
localScopes.addIfNotNull(primaryConstructorParametersScope)
|
||||
components.withContainer(property) {
|
||||
property.transformChildrenWithoutAccessors(returnTypeRef)
|
||||
if (property.initializer != null) {
|
||||
storeVariableReturnType(property)
|
||||
}
|
||||
withScopeCleanup(localScopes) {
|
||||
localScopes.add(FirLocalScope().apply {
|
||||
storeBackingField(property)
|
||||
})
|
||||
property.transformAccessors()
|
||||
}
|
||||
}
|
||||
property.replaceResolvePhase(transformerPhase)
|
||||
val controlFlowGraph = dataFlowAnalyzer.exitProperty(property)
|
||||
property.transformControlFlowGraphReference(ControlFlowGraphReferenceTransformer, controlFlowGraph)
|
||||
property.compose()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun transformLocalVariable(variable: FirProperty): CompositeTransformResult<FirDeclaration> {
|
||||
assert(variable.isLocal)
|
||||
variable.transformOtherChildren(transformer, withExpectedType(variable.returnTypeRef))
|
||||
if (variable.initializer != null) {
|
||||
@@ -137,31 +178,97 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
|
||||
} as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
|
||||
override fun transformRegularClass(regularClass: FirRegularClass, data: ResolutionMode): CompositeTransformResult<FirStatement> {
|
||||
localScopes.lastOrNull()?.storeDeclaration(regularClass)
|
||||
val oldConstructorScope = primaryConstructorParametersScope
|
||||
primaryConstructorParametersScope = null
|
||||
val type = regularClass.defaultType()
|
||||
val result = withLabelAndReceiverType(regularClass.name, regularClass, type) {
|
||||
val constructor = regularClass.declarations.firstOrNull() as? FirConstructor
|
||||
if (constructor?.isPrimary == true) {
|
||||
primaryConstructorParametersScope = FirLocalScope().apply {
|
||||
constructor.valueParameters.forEach { this.storeDeclaration(it) }
|
||||
private fun FirDeclaration.resolveStatus(status: FirDeclarationStatus, containingClass: FirClass<*>? = null): FirDeclarationStatus {
|
||||
val containingDeclaration = components.containerIfAny
|
||||
return resolveStatus(
|
||||
status, containingClass as? FirRegularClass, isLocal = containingDeclaration != null && containingClass == null
|
||||
)
|
||||
}
|
||||
|
||||
private fun prepareLocalClassForBodyResolve(klass: FirClass<*>) {
|
||||
if (klass.supertypesComputationStatus == SupertypesComputationStatus.NOT_COMPUTED) {
|
||||
klass.replaceSuperTypeRefs(
|
||||
klass.superTypeRefs.map { superTypeRef ->
|
||||
this.transformer.transformTypeRef(superTypeRef, ResolutionMode.ContextIndependent).single
|
||||
}
|
||||
)
|
||||
klass.replaceSupertypesComputationStatus(SupertypesComputationStatus.COMPUTED)
|
||||
}
|
||||
if (klass is FirRegularClass) {
|
||||
klass.transformStatus(transformer, klass.resolveStatus(klass.status).mode())
|
||||
}
|
||||
// This is necessary because of possible jumps from implicit bodies inside
|
||||
for (declaration in klass.declarations) {
|
||||
when (declaration) {
|
||||
is FirRegularClass -> {
|
||||
prepareLocalClassForBodyResolve(declaration)
|
||||
}
|
||||
is FirCallableMemberDeclaration<*> -> {
|
||||
withScopeCleanup(topLevelScopes) {
|
||||
prepareTypeParameterOwnerForBodyResolve(declaration)
|
||||
prepareSignatureForBodyResolve(declaration)
|
||||
declaration.transformStatus(transformer, declaration.resolveStatus(declaration.status, klass).mode())
|
||||
if (declaration is FirProperty) {
|
||||
declaration.getter?.let { it.transformStatus(this, it.resolveStatus(it.status, klass).mode()) }
|
||||
declaration.setter?.let { it.transformStatus(this, it.resolveStatus(it.status, klass).mode()) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
transformDeclaration(regularClass, data)
|
||||
declaration.replaceResolvePhase(FirResolvePhase.STATUS)
|
||||
}
|
||||
if (klass is FirRegularClass) {
|
||||
for (typeParameter in klass.typeParameters) {
|
||||
typeParameter.replaceResolvePhase(FirResolvePhase.STATUS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformRegularClass(regularClass: FirRegularClass, data: ResolutionMode): CompositeTransformResult<FirStatement> {
|
||||
localScopes.lastOrNull()?.storeDeclaration(regularClass)
|
||||
return withScopeCleanup(topLevelScopes) {
|
||||
prepareTypeParameterOwnerForBodyResolve(regularClass)
|
||||
if (regularClass.symbol.classId.isLocal) {
|
||||
prepareLocalClassForBodyResolve(regularClass)
|
||||
}
|
||||
val companionObjects = regularClass.declarations.filterIsInstance<FirRegularClass>().filter { it.isCompanion }
|
||||
for (companionObject in companionObjects) {
|
||||
topLevelScopes += nestedClassifierScope(companionObject)
|
||||
}
|
||||
topLevelScopes += nestedClassifierScope(regularClass)
|
||||
|
||||
val oldConstructorScope = primaryConstructorParametersScope
|
||||
val oldContainingClass = containingClass
|
||||
primaryConstructorParametersScope = null
|
||||
containingClass = regularClass
|
||||
val type = regularClass.defaultType()
|
||||
val result = withLabelAndReceiverType(regularClass.name, regularClass, type) {
|
||||
val constructor = regularClass.declarations.firstOrNull() as? FirConstructor
|
||||
if (constructor?.isPrimary == true) {
|
||||
primaryConstructorParametersScope = FirLocalScope().apply {
|
||||
constructor.valueParameters.forEach { this.storeDeclaration(it) }
|
||||
}
|
||||
}
|
||||
transformDeclaration(regularClass, data)
|
||||
}
|
||||
containingClass = oldContainingClass
|
||||
primaryConstructorParametersScope = oldConstructorScope
|
||||
result as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
primaryConstructorParametersScope = oldConstructorScope
|
||||
return result as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
|
||||
override fun transformAnonymousObject(anonymousObject: FirAnonymousObject, data: ResolutionMode): CompositeTransformResult<FirStatement> {
|
||||
val type = anonymousObject.defaultType()
|
||||
anonymousObject.resultType = FirResolvedTypeRefImpl(anonymousObject.source, type)
|
||||
val result = withLabelAndReceiverType(null, anonymousObject, type) {
|
||||
transformDeclaration(anonymousObject, data)
|
||||
prepareLocalClassForBodyResolve(anonymousObject)
|
||||
return withScopeCleanup(topLevelScopes) {
|
||||
topLevelScopes += nestedClassifierScope(anonymousObject)
|
||||
|
||||
val type = anonymousObject.defaultType()
|
||||
anonymousObject.resultType = FirResolvedTypeRefImpl(anonymousObject.source, type)
|
||||
val result = withLabelAndReceiverType(null, anonymousObject, type) {
|
||||
transformDeclaration(anonymousObject, data)
|
||||
}
|
||||
result as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
return result as CompositeTransformResult<FirStatement>
|
||||
}
|
||||
|
||||
private fun transformAnonymousFunctionWithLambdaResolution(
|
||||
@@ -192,22 +299,31 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
|
||||
}
|
||||
|
||||
override fun transformSimpleFunction(simpleFunction: FirSimpleFunction, data: ResolutionMode): CompositeTransformResult<FirDeclaration> {
|
||||
val returnTypeRef = simpleFunction.returnTypeRef
|
||||
if ((returnTypeRef !is FirImplicitTypeRef) && implicitTypeOnly) {
|
||||
return simpleFunction.compose()
|
||||
}
|
||||
return withFullBodyResolve {
|
||||
if (returnTypeRef is FirImplicitTypeRef) {
|
||||
simpleFunction.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||
return withScopeCleanup(topLevelScopes) {
|
||||
prepareTypeParameterOwnerForBodyResolve(simpleFunction)
|
||||
val containingDeclaration = components.containerIfAny
|
||||
if (containingDeclaration != null && containingDeclaration !is FirClass<*>) {
|
||||
// For class members everything should be already prepared
|
||||
prepareSignatureForBodyResolve(simpleFunction)
|
||||
simpleFunction.transformStatus(this, simpleFunction.resolveStatus(simpleFunction.status).mode())
|
||||
}
|
||||
val returnTypeRef = simpleFunction.returnTypeRef
|
||||
if ((returnTypeRef !is FirImplicitTypeRef) && implicitTypeOnly) {
|
||||
return@withScopeCleanup simpleFunction.compose()
|
||||
}
|
||||
withFullBodyResolve {
|
||||
if (returnTypeRef is FirImplicitTypeRef) {
|
||||
simpleFunction.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||
}
|
||||
|
||||
val receiverTypeRef = simpleFunction.receiverTypeRef
|
||||
if (receiverTypeRef != null) {
|
||||
withLabelAndReceiverType(simpleFunction.name, simpleFunction, receiverTypeRef.coneTypeUnsafe()) {
|
||||
val receiverTypeRef = simpleFunction.receiverTypeRef
|
||||
if (receiverTypeRef != null) {
|
||||
withLabelAndReceiverType(simpleFunction.name, simpleFunction, receiverTypeRef.coneTypeUnsafe()) {
|
||||
transformFunctionWithGivenSignature(simpleFunction, returnTypeRef)
|
||||
}
|
||||
} else {
|
||||
transformFunctionWithGivenSignature(simpleFunction, returnTypeRef)
|
||||
}
|
||||
} else {
|
||||
transformFunctionWithGivenSignature(simpleFunction, returnTypeRef)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,7 +386,16 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
|
||||
return (transformDeclaration(valueParameter, withExpectedType(valueParameter.returnTypeRef)).single as FirStatement).compose()
|
||||
}
|
||||
|
||||
override fun transformAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: ResolutionMode): CompositeTransformResult<FirStatement> {
|
||||
override fun transformAnonymousFunction(
|
||||
anonymousFunction: FirAnonymousFunction,
|
||||
data: ResolutionMode
|
||||
): CompositeTransformResult<FirStatement> {
|
||||
// Either ContextDependent, ContextIndependent or WithExpectedType could be here
|
||||
if (data !is ResolutionMode.LambdaResolution) {
|
||||
anonymousFunction.transformReturnTypeRef(transformer, ResolutionMode.ContextIndependent)
|
||||
anonymousFunction.transformReceiverTypeRef(transformer, ResolutionMode.ContextIndependent)
|
||||
anonymousFunction.valueParameters.forEach { it.transformReturnTypeRef(transformer, ResolutionMode.ContextIndependent) }
|
||||
}
|
||||
return when (data) {
|
||||
ResolutionMode.ContextDependent -> {
|
||||
anonymousFunction.compose()
|
||||
@@ -343,9 +468,12 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
|
||||
af.replaceTypeRef(af.constructFunctionalTypeRef(session))
|
||||
af.compose()
|
||||
}
|
||||
is ResolutionMode.ContextIndependent -> {
|
||||
ResolutionMode.ContextIndependent -> {
|
||||
transformFunction(anonymousFunction, data).single.compose()
|
||||
}
|
||||
is ResolutionMode.WithStatus -> {
|
||||
throw AssertionError("Should not be here in WithStatus mode")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-8
@@ -79,14 +79,23 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
|
||||
qualifiedAccessExpression
|
||||
}
|
||||
is FirSuperReference -> {
|
||||
if (callee.superTypeRef is FirResolvedTypeRef) {
|
||||
qualifiedAccessExpression.resultType = callee.superTypeRef
|
||||
} else {
|
||||
val superTypeRef = implicitReceiverStack.lastDispatchReceiver()
|
||||
?.boundSymbol?.phasedFir?.superTypeRefs?.firstOrNull()
|
||||
?: FirErrorTypeRefImpl(qualifiedAccessExpression.source, FirSimpleDiagnostic("No super type", DiagnosticKind.NoSupertype))
|
||||
qualifiedAccessExpression.resultType = superTypeRef
|
||||
callee.replaceSuperTypeRef(superTypeRef)
|
||||
when (val superTypeRef = callee.superTypeRef) {
|
||||
is FirResolvedTypeRef -> {
|
||||
qualifiedAccessExpression.resultType = superTypeRef
|
||||
}
|
||||
!is FirImplicitTypeRef -> {
|
||||
callee.transformChildren(transformer, ResolutionMode.ContextIndependent)
|
||||
qualifiedAccessExpression.resultType = callee.superTypeRef
|
||||
}
|
||||
else -> {
|
||||
val superTypeRefFromStack = implicitReceiverStack.lastDispatchReceiver()
|
||||
?.boundSymbol?.phasedFir?.superTypeRefs?.firstOrNull()
|
||||
?: FirErrorTypeRefImpl(
|
||||
qualifiedAccessExpression.source, FirSimpleDiagnostic("No super type", DiagnosticKind.NoSupertype)
|
||||
)
|
||||
qualifiedAccessExpression.resultType = superTypeRefFromStack
|
||||
callee.replaceSuperTypeRef(superTypeRefFromStack)
|
||||
}
|
||||
}
|
||||
qualifiedAccessExpression
|
||||
}
|
||||
@@ -139,6 +148,7 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
|
||||
dataFlowAnalyzer.enterFunctionCall(functionCall)
|
||||
if (functionCall.calleeReference !is FirSimpleNamedReference) return functionCall.compose()
|
||||
functionCall.transform<FirFunctionCall, Nothing?>(InvocationKindTransformer, null)
|
||||
functionCall.transformTypeArguments(transformer, ResolutionMode.ContextIndependent)
|
||||
val expectedTypeRef = data.expectedType
|
||||
val completeInference =
|
||||
try {
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir.scopes.impl
|
||||
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassifierSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
class FirTypeResolveScopeForBodyResolve(
|
||||
private val topLevelScopes: List<FirScope>,
|
||||
private val localScopes: List<FirScope>
|
||||
) : FirScope() {
|
||||
override fun processClassifiersByName(
|
||||
name: Name,
|
||||
processor: (FirClassifierSymbol<*>) -> ProcessorAction
|
||||
): ProcessorAction {
|
||||
for (scope in localScopes.asReversed()) {
|
||||
if (!scope.processClassifiersByName(name, processor)) {
|
||||
return ProcessorAction.STOP
|
||||
}
|
||||
}
|
||||
for (scope in topLevelScopes.asReversed()) {
|
||||
if (!scope.processClassifiersByName(name, processor)) {
|
||||
return ProcessorAction.STOP
|
||||
}
|
||||
}
|
||||
return ProcessorAction.NEXT
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -28,7 +28,7 @@ digraph complex_kt {
|
||||
12 [label="Access variable R|<local>/url|"];
|
||||
13 [label="Function call: <Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|)"];
|
||||
14 [label="Function call: <Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|).<Unresolved name: connect>#(<L> = connect@fun <implicit>.<anonymous>(): <implicit> {
|
||||
GsonBuilder#().create#().fromJson#(it#.inputStream#.reader#(), <getClass>(Array#<R|class error: Symbol not found, for `PluginDTO`|>()).java#)
|
||||
GsonBuilder#().create#().fromJson#(it#.inputStream#.reader#(), <getClass>(Array#<PluginDTO>()).java#)
|
||||
}
|
||||
)"];
|
||||
15 [label="Exit block"];
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ FILE: complex.kt
|
||||
lval url: R|kotlin/String| = <strcat>(String(https://plugins.jetbrains.com/api/plugins/), R|<local>/pluginId|.<Unresolved name: idString>#, String(/updates?version=), R|<local>/version|)
|
||||
lval pluginDTOs: R|kotlin/Array<class error: Symbol not found, for `PluginDTO`>| = try {
|
||||
<Unresolved name: HttpRequests>#.<Unresolved name: request>#(R|<local>/url|).<Unresolved name: connect>#(<L> = connect@fun <implicit>.<anonymous>(): <implicit> {
|
||||
GsonBuilder#().create#().fromJson#(it#.inputStream#.reader#(), <getClass>(Array#<R|class error: Symbol not found, for `PluginDTO`|>()).java#)
|
||||
GsonBuilder#().create#().fromJson#(it#.inputStream#.reader#(), <getClass>(Array#<PluginDTO>()).java#)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ FILE: localImplicitBodies.kt
|
||||
}
|
||||
|
||||
public final fun sss(): <ERROR TYPE REF: Cannot calculate return type (local class/object?)> {
|
||||
^sss R?C|/abc|()
|
||||
^sss R?C|/anonymous.abc|()
|
||||
}
|
||||
|
||||
public final fun abc(): R|kotlin/Int| {
|
||||
@@ -15,5 +15,5 @@ FILE: localImplicitBodies.kt
|
||||
|
||||
}
|
||||
|
||||
lval g: <ERROR TYPE REF: Cannot calculate return type (local class/object?)> = R|<local>/x|.R?C|/sss|()
|
||||
lval g: <ERROR TYPE REF: Cannot calculate return type (local class/object?)> = R|<local>/x|.R?C|/anonymous.sss|()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
interface Foo
|
||||
|
||||
fun bar() {
|
||||
object : Foo {
|
||||
fun foo(): Foo {
|
||||
return Derived(42)
|
||||
}
|
||||
|
||||
inner class Derived(val x: Int) : Foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
FILE: localInnerClass.kt
|
||||
public abstract interface Foo : R|kotlin/Any| {
|
||||
}
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
object : R|Foo| {
|
||||
private constructor(): R|kotlin/Any| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|Foo| {
|
||||
^foo R|/<anonymous>.Derived.Derived|(Int(42))
|
||||
}
|
||||
|
||||
local final inner class Derived : R|Foo| {
|
||||
public constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val x: R|kotlin/Int| = R|<local>/x|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,6 @@ fun test() {
|
||||
|
||||
val derived = DerivedLocal()
|
||||
derived.gau()
|
||||
derived.<!UNRESOLVED_REFERENCE!>baz<!>()
|
||||
derived.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
derived.baz()
|
||||
derived.foo()
|
||||
}
|
||||
@@ -32,11 +32,11 @@ FILE: localScopes.kt
|
||||
|
||||
}
|
||||
|
||||
R|<local>/anonymous|.R|/baz|()
|
||||
R|<local>/anonymous|.R|/anonymous.baz|()
|
||||
R|<local>/anonymous|.R|/Bar.foo|()
|
||||
local final class DerivedLocal : R|class error: Symbol not found, for `BaseLocal`| {
|
||||
local final class DerivedLocal : R|BaseLocal| {
|
||||
public constructor(): R|DerivedLocal| {
|
||||
super<R|class error: Symbol not found, for `BaseLocal`|>()
|
||||
super<R|BaseLocal|>()
|
||||
}
|
||||
|
||||
public final fun gau(): R|kotlin/Unit| {
|
||||
@@ -46,6 +46,6 @@ FILE: localScopes.kt
|
||||
|
||||
lval derived: R|DerivedLocal| = R|/DerivedLocal.DerivedLocal|()
|
||||
R|<local>/derived|.R|/DerivedLocal.gau|()
|
||||
R|<local>/derived|.<Unresolved name: baz>#()
|
||||
R|<local>/derived|.<Unresolved name: foo>#()
|
||||
R|<local>/derived|.R|/BaseLocal.baz|()
|
||||
R|<local>/derived|.R|/Bar.foo|()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
interface Foo
|
||||
|
||||
fun foo() {
|
||||
val x: Int = 1
|
||||
class Bar : Foo {
|
||||
val y: String = ""
|
||||
fun Int.bar(s: String): Boolean {
|
||||
val z: Double = 0.0
|
||||
return true
|
||||
}
|
||||
val Boolean.w: Char get() = ' '
|
||||
fun <T : Foo> id(arg: T): T = arg
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
FILE: localTypes.kt
|
||||
public abstract interface Foo : R|kotlin/Any| {
|
||||
}
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Int| = Int(1)
|
||||
local final class Bar : R|Foo| {
|
||||
public constructor(): R|Bar| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val y: R|kotlin/String| = String()
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final fun R|kotlin/Int|.bar(s: R|kotlin/String|): R|kotlin/Boolean| {
|
||||
lval z: R|kotlin/Double| = Double(0.0)
|
||||
^bar Boolean(true)
|
||||
}
|
||||
|
||||
public final val R|kotlin/Boolean|.w: R|kotlin/Char|
|
||||
public get(): R|kotlin/Char| {
|
||||
^ Char( )
|
||||
}
|
||||
|
||||
public final fun <T : R|Foo|> id(arg: R|T|): R|T| {
|
||||
^id R|<local>/arg|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class C {
|
||||
private val x = object {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
val y = x.foo()
|
||||
|
||||
internal val z = object {
|
||||
fun foo() = 13
|
||||
}
|
||||
|
||||
val w = z.foo() // ERROR!
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
FILE: privateObjectLiteral.kt
|
||||
public final class C : R|kotlin/Any| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final val x: R|anonymous| = object : R|kotlin/Any| {
|
||||
private constructor(): R|kotlin/Any| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(42)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private get(): R|anonymous|
|
||||
|
||||
public final val y: R|kotlin/Int| = this@R|/C|.R|/C.x|.R|/anonymous.foo|()
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
internal final val z: R|anonymous| = object : R|kotlin/Any| {
|
||||
private constructor(): R|kotlin/Any| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(13)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal get(): R|anonymous|
|
||||
|
||||
public final val w: R|kotlin/Int| = this@R|/C|.R|/C.z|.R|/anonymous.foo|()
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
@@ -38,8 +38,8 @@ FILE: kotlinSam.kt
|
||||
}
|
||||
)
|
||||
R|/foo1|(R|<local>/f|)
|
||||
<Inapplicable(INAPPLICABLE): [/foo2]>#(<L> = foo2@fun <anonymous>(x: R|kotlin/Nothing|): R|kotlin/Boolean|
|
||||
>(R|<local>/x|, Int(1))
|
||||
<Inapplicable(INAPPLICABLE): [/foo2]>#(<L> = foo2@fun <implicit>.<anonymous>(x: <implicit>): <implicit> {
|
||||
>(x#, Int(1))
|
||||
}
|
||||
)
|
||||
<Inapplicable(INAPPLICABLE): [/foo2]>#(R|<local>/f|)
|
||||
|
||||
+4
-4
@@ -2,12 +2,12 @@ FILE: main.kt
|
||||
public final fun foo(m: R|MyRunnable|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(<L> = foo@fun <anonymous>(x: R|kotlin/Nothing|): R|kotlin/Boolean| {
|
||||
>(R|<local>/x|, Int(1))
|
||||
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(<L> = foo@fun <implicit>.<anonymous>(x: <implicit>): <implicit> {
|
||||
>(x#, Int(1))
|
||||
}
|
||||
)
|
||||
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(foo@fun <anonymous>(): R|kotlin/Boolean| {
|
||||
>(<Unresolved name: it>#, Int(1))
|
||||
Q|JavaUsage|.<Inapplicable(INAPPLICABLE): [/JavaUsage.foo]>#(foo@fun <implicit>.<anonymous>(): <implicit> {
|
||||
>(it#, Int(1))
|
||||
}
|
||||
)
|
||||
lval x: R|kotlin/Function1<kotlin/Int, kotlin/Boolean>| = fun <anonymous>(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
|
||||
@@ -15,7 +15,7 @@ FILE: anonymousInDelegate.kt
|
||||
|
||||
}
|
||||
|
||||
R|<local>/foo|.R|/bar|()
|
||||
R|<local>/foo|.R|/anonymous.bar|()
|
||||
}
|
||||
)
|
||||
public get(): R|kotlin/Int| {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
fun convert(vararg paths: String): Array<String> = paths.toList().toTypedArray()
|
||||
|
||||
convert("1", "2", "3")
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
FILE: arrayInLocal.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
local final fun convert(vararg paths: R|kotlin/Array<kotlin/String>|): R|kotlin/Array<kotlin/String>| {
|
||||
^convert R|<local>/paths|.R|kotlin/collections/toList|<R|kotlin/String|>().R|kotlin/collections/toTypedArray|<R|kotlin/String|>()
|
||||
}
|
||||
|
||||
R|<local>/convert|(String(1), String(2), String(3))
|
||||
}
|
||||
@@ -10,7 +10,7 @@ FILE: problems.kt
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
R|/name|
|
||||
R|/anonymous.name|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,3 +3,8 @@ import kotlin.reflect.KClass
|
||||
val javaClass: Class<String> = String::class.java
|
||||
val kotlinClass: KClass<String> = String::class
|
||||
|
||||
fun foo() {
|
||||
val stringClass = String::class.java
|
||||
val arrayStringClass = <!INAPPLICABLE_CANDIDATE!>Array<!><String>::class.<!INAPPLICABLE_CANDIDATE!>java<!>
|
||||
}
|
||||
|
||||
|
||||
@@ -3,3 +3,7 @@ FILE: reflectionClass.kt
|
||||
public get(): R|java/lang/Class<kotlin/String>|
|
||||
public final val kotlinClass: R|kotlin/reflect/KClass<kotlin/String>| = <getClass>(Q|kotlin/String|)
|
||||
public get(): R|kotlin/reflect/KClass<kotlin/String>|
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval stringClass: R|java/lang/Class<kotlin/String>| = <getClass>(Q|kotlin/String|).R|kotlin/jvm/java|
|
||||
lval arrayStringClass: <ERROR TYPE REF: Empty diagnostic> = <getClass>(<Inapplicable(PARAMETER_MAPPING_ERROR): [kotlin/Array.Array]>#<R|kotlin/String|>()).<Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#
|
||||
}
|
||||
|
||||
+15
@@ -369,11 +369,21 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/localImplicitBodies.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localInnerClass.kt")
|
||||
public void testLocalInnerClass() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/localInnerClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localScopes.kt")
|
||||
public void testLocalScopes() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/localScopes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localTypes.kt")
|
||||
public void testLocalTypes() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/localTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("memberExtension.kt")
|
||||
public void testMemberExtension() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/memberExtension.kt");
|
||||
@@ -394,6 +404,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/outerObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("privateObjectLiteral.kt")
|
||||
public void testPrivateObjectLiteral() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/privateObjectLiteral.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("qualifiedExpressions.kt")
|
||||
public void testQualifiedExpressions() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/qualifiedExpressions.kt");
|
||||
|
||||
Generated
+5
@@ -38,6 +38,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/arrayFirstOrNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("arrayInLocal.kt")
|
||||
public void testArrayInLocal() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/arrayInLocal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("backingField.kt")
|
||||
public void testBackingField() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/backingField.kt");
|
||||
|
||||
@@ -45,6 +45,8 @@ abstract class FirAnonymousFunction : FirPureAbstractElement(), FirFunction<FirA
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
|
||||
@@ -30,4 +30,6 @@ interface FirCallableDeclaration<F : FirCallableDeclaration<F>> : FirTypedDeclar
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitCallableDeclaration(this, data)
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirCallableDeclaration<F>
|
||||
|
||||
fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirCallableDeclaration<F>
|
||||
}
|
||||
|
||||
+4
@@ -35,4 +35,8 @@ interface FirCallableMemberDeclaration<F : FirCallableMemberDeclaration<F>> : Fi
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitCallableMemberDeclaration(this, data)
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirCallableMemberDeclaration<F>
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirCallableMemberDeclaration<F>
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirCallableMemberDeclaration<F>
|
||||
}
|
||||
|
||||
@@ -44,7 +44,11 @@ interface FirConstructor : FirMemberFunction<FirConstructor> {
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
|
||||
override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
}
|
||||
|
||||
@@ -40,5 +40,7 @@ abstract class FirEnumEntry : FirPureAbstractElement(), FirRegularClass {
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitEnumEntry(this, data)
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirEnumEntry
|
||||
|
||||
abstract fun <D> transformArguments(transformer: FirTransformer<D>, data: D): FirEnumEntry
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ abstract class FirErrorFunction : FirPureAbstractElement(), FirFunction<FirError
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
|
||||
@@ -46,9 +46,13 @@ abstract class FirField : FirPureAbstractElement(), FirVariable<FirField>, FirCa
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirField
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirField
|
||||
|
||||
abstract override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirField
|
||||
|
||||
abstract override fun <D> transformSetter(transformer: FirTransformer<D>, data: D): FirField
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirField
|
||||
|
||||
abstract override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirField
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ interface FirFunction<F : FirFunction<F>> : FirCallableDeclaration<F>, FirContro
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
|
||||
fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
|
||||
@@ -27,4 +27,6 @@ interface FirMemberDeclaration : FirNamedDeclaration, FirAnnotationContainer {
|
||||
val status: FirDeclarationStatus
|
||||
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitMemberDeclaration(this, data)
|
||||
|
||||
fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirMemberDeclaration
|
||||
}
|
||||
|
||||
@@ -41,7 +41,11 @@ interface FirMemberFunction<F : FirMemberFunction<F>> : FirFunction<F>, FirCalla
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirMemberFunction<F>
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirMemberFunction<F>
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirMemberFunction<F>
|
||||
|
||||
override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirMemberFunction<F>
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirMemberFunction<F>
|
||||
}
|
||||
|
||||
@@ -52,11 +52,15 @@ abstract class FirProperty : FirPureAbstractElement(), FirVariable<FirProperty>,
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
|
||||
abstract override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
|
||||
abstract override fun <D> transformSetter(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
|
||||
abstract override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirProperty
|
||||
}
|
||||
|
||||
@@ -42,9 +42,13 @@ abstract class FirPropertyAccessor : FirPureAbstractElement(), FirFunction<FirPr
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract override fun <D> transformContractDescription(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
}
|
||||
|
||||
@@ -37,4 +37,6 @@ interface FirRegularClass : FirMemberDeclaration, FirTypeParametersOwner, FirCla
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitRegularClass(this, data)
|
||||
|
||||
override fun replaceSuperTypeRefs(newSuperTypeRefs: List<FirTypeRef>)
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirRegularClass
|
||||
}
|
||||
|
||||
@@ -40,4 +40,6 @@ abstract class FirSealedClass : FirPureAbstractElement(), FirRegularClass {
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitSealedClass(this, data)
|
||||
|
||||
abstract fun replaceInheritors(newInheritors: List<ClassId>)
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirSealedClass
|
||||
}
|
||||
|
||||
@@ -44,9 +44,13 @@ abstract class FirSimpleFunction : FirPureAbstractElement(), FirMemberFunction<F
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformContractDescription(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
}
|
||||
|
||||
@@ -34,4 +34,6 @@ abstract class FirTypeAlias : FirPureAbstractElement(), FirClassLikeDeclaration<
|
||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitTypeAlias(this, data)
|
||||
|
||||
abstract fun replaceExpandedTypeRef(newExpandedTypeRef: FirTypeRef)
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirTypeAlias
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ abstract class FirValueParameter : FirPureAbstractElement(), FirVariable<FirValu
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirValueParameter
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirValueParameter
|
||||
|
||||
abstract override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirValueParameter
|
||||
|
||||
abstract override fun <D> transformSetter(transformer: FirTransformer<D>, data: D): FirValueParameter
|
||||
|
||||
@@ -42,6 +42,8 @@ interface FirVariable<F : FirVariable<F>> : FirCallableDeclaration<F>, FirNamedD
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirVariable<F>
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirVariable<F>
|
||||
|
||||
fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirVariable<F>
|
||||
|
||||
fun <D> transformSetter(transformer: FirTransformer<D>, data: D): FirVariable<F>
|
||||
|
||||
+6
-1
@@ -64,7 +64,7 @@ class FirAnonymousFunctionImpl(
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirAnonymousFunctionImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
transformReturnTypeRef(transformer, data)
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
@@ -79,6 +79,11 @@ class FirAnonymousFunctionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirAnonymousFunctionImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirAnonymousFunctionImpl {
|
||||
controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
@@ -59,7 +59,7 @@ class FirClassImpl(
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirClassImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
(declarations.firstOrNull { it is FirConstructorImpl } as? FirConstructorImpl)?.typeParameters?.transformInplace(transformer, data)
|
||||
declarations.transformInplace(transformer, data)
|
||||
companionObject = declarations.asSequence().filterIsInstance<FirRegularClass>().firstOrNull { it.status.isCompanion }
|
||||
@@ -67,6 +67,11 @@ class FirClassImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirClassImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+12
-2
@@ -65,11 +65,11 @@ open class FirConstructorImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
delegatedConstructor = delegatedConstructor?.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -80,6 +80,11 @@ open class FirConstructorImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
|
||||
controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -90,6 +95,11 @@ open class FirConstructorImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+6
-1
@@ -64,6 +64,7 @@ class FirDefaultSetterValueParameter(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirDefaultSetterValueParameter {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformGetter(transformer, data)
|
||||
transformSetter(transformer, data)
|
||||
transformOtherChildren(transformer, data)
|
||||
@@ -75,6 +76,11 @@ class FirDefaultSetterValueParameter(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirDefaultSetterValueParameter {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirDefaultSetterValueParameter {
|
||||
getter = getter?.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -86,7 +92,6 @@ class FirDefaultSetterValueParameter(
|
||||
}
|
||||
|
||||
override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirDefaultSetterValueParameter {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
initializer = initializer?.transformSingle(transformer, data)
|
||||
delegate = delegate?.transformSingle(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
|
||||
+6
-1
@@ -65,7 +65,7 @@ class FirEnumEntryImpl(
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirEnumEntryImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
declarations.transformInplace(transformer, data)
|
||||
superTypeRefs.transformInplace(transformer, data)
|
||||
transformArguments(transformer, data)
|
||||
@@ -73,6 +73,11 @@ class FirEnumEntryImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirEnumEntryImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformArguments(transformer: FirTransformer<D>, data: D): FirEnumEntryImpl {
|
||||
arguments.transformInplace(transformer, data)
|
||||
return this
|
||||
|
||||
+4
@@ -68,6 +68,10 @@ class FirErrorFunctionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirErrorFunctionImpl {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirErrorFunctionImpl {
|
||||
controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
@@ -62,6 +62,7 @@ class FirFieldImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirFieldImpl {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
transformOtherChildren(transformer, data)
|
||||
return this
|
||||
}
|
||||
@@ -71,6 +72,10 @@ class FirFieldImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirFieldImpl {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirFieldImpl {
|
||||
return this
|
||||
}
|
||||
@@ -79,10 +84,14 @@ class FirFieldImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirFieldImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirFieldImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -51,9 +51,13 @@ abstract class FirModifiableConstructor : FirPureAbstractElement(), FirConstruct
|
||||
|
||||
abstract override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirModifiableConstructor
|
||||
|
||||
abstract override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirModifiableConstructor
|
||||
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirModifiableConstructor
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirModifiableConstructor
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirModifiableConstructor
|
||||
|
||||
abstract override fun replaceResolvePhase(newResolvePhase: FirResolvePhase)
|
||||
}
|
||||
|
||||
+2
@@ -41,6 +41,8 @@ interface FirModifiableFunction<F : FirFunction<F>> : FirFunction<F>, FirAbstra
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirModifiableFunction<F>
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirModifiableFunction<F>
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirModifiableFunction<F>
|
||||
|
||||
override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirModifiableFunction<F>
|
||||
|
||||
+2
@@ -42,6 +42,8 @@ interface FirModifiableRegularClass : FirRegularClass, FirModifiableClass<FirReg
|
||||
override val superTypeRefs: MutableList<FirTypeRef>
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirModifiableRegularClass
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirModifiableRegularClass
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase)
|
||||
|
||||
override fun replaceSupertypesComputationStatus(newSupertypesComputationStatus: SupertypesComputationStatus)
|
||||
|
||||
+2
@@ -44,6 +44,8 @@ interface FirModifiableVariable<F : FirVariable<F>> : FirVariable<F>, FirAbstra
|
||||
|
||||
override fun <D> transformReturnTypeRef(transformer: FirTransformer<D>, data: D): FirModifiableVariable<F>
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirModifiableVariable<F>
|
||||
|
||||
override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirModifiableVariable<F>
|
||||
|
||||
override fun <D> transformSetter(transformer: FirTransformer<D>, data: D): FirModifiableVariable<F>
|
||||
|
||||
+12
-2
@@ -65,13 +65,13 @@ open class FirPropertyAccessorImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirPropertyAccessorImpl {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
transformContractDescription(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
return this
|
||||
}
|
||||
@@ -81,6 +81,11 @@ open class FirPropertyAccessorImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirPropertyAccessorImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirPropertyAccessorImpl {
|
||||
controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -96,6 +101,11 @@ open class FirPropertyAccessorImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirPropertyAccessorImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+12
-2
@@ -75,9 +75,11 @@ class FirPropertyImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirPropertyImpl {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformGetter(transformer, data)
|
||||
transformSetter(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
transformOtherChildren(transformer, data)
|
||||
return this
|
||||
}
|
||||
@@ -87,6 +89,11 @@ class FirPropertyImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirPropertyImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirPropertyImpl {
|
||||
getter = getter?.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -102,13 +109,16 @@ class FirPropertyImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirPropertyImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirPropertyImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
initializer = initializer?.transformSingle(transformer, data)
|
||||
delegate = delegate?.transformSingle(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -61,7 +61,7 @@ class FirSealedClassImpl(
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirSealedClassImpl {
|
||||
annotations.transformInplace(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
(declarations.firstOrNull { it is FirConstructorImpl } as? FirConstructorImpl)?.typeParameters?.transformInplace(transformer, data)
|
||||
declarations.transformInplace(transformer, data)
|
||||
companionObject = declarations.asSequence().filterIsInstance<FirRegularClass>().firstOrNull { it.status.isCompanion }
|
||||
@@ -69,6 +69,11 @@ class FirSealedClassImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirSealedClassImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+12
-2
@@ -66,12 +66,12 @@ open class FirSimpleFunctionImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
transformContractDescription(transformer, data)
|
||||
return this
|
||||
@@ -82,6 +82,11 @@ open class FirSimpleFunctionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -92,6 +97,11 @@ open class FirSimpleFunctionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformContractDescription(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
contractDescription = contractDescription.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
+6
-1
@@ -50,12 +50,17 @@ class FirTypeAliasImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirTypeAliasImpl {
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
status = status.transformSingle(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
expandedTypeRef = expandedTypeRef.transformSingle(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirTypeAliasImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+6
-1
@@ -64,6 +64,7 @@ open class FirValueParameterImpl(
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirValueParameterImpl {
|
||||
transformReturnTypeRef(transformer, data)
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformGetter(transformer, data)
|
||||
transformSetter(transformer, data)
|
||||
transformOtherChildren(transformer, data)
|
||||
@@ -75,6 +76,11 @@ open class FirValueParameterImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformReceiverTypeRef(transformer: FirTransformer<D>, data: D): FirValueParameterImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformGetter(transformer: FirTransformer<D>, data: D): FirValueParameterImpl {
|
||||
getter = getter?.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -86,7 +92,6 @@ open class FirValueParameterImpl(
|
||||
}
|
||||
|
||||
override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirValueParameterImpl {
|
||||
receiverTypeRef = receiverTypeRef?.transformSingle(transformer, data)
|
||||
initializer = initializer?.transformSingle(transformer, data)
|
||||
delegate = delegate?.transformSingle(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
|
||||
@@ -37,6 +37,8 @@ abstract class FirComponentCall : FirFunctionCall() {
|
||||
|
||||
abstract override fun <D> transformArguments(transformer: FirTransformer<D>, data: D): FirComponentCall
|
||||
|
||||
abstract override fun <D> transformTypeArguments(transformer: FirTransformer<D>, data: D): FirComponentCall
|
||||
|
||||
abstract override fun <D> transformCalleeReference(transformer: FirTransformer<D>, data: D): FirComponentCall
|
||||
|
||||
abstract override fun <D> transformExplicitReceiver(transformer: FirTransformer<D>, data: D): FirComponentCall
|
||||
|
||||
@@ -38,5 +38,7 @@ abstract class FirFunctionCall : FirQualifiedAccessExpression(), FirCall {
|
||||
|
||||
abstract override fun <D> transformArguments(transformer: FirTransformer<D>, data: D): FirFunctionCall
|
||||
|
||||
abstract fun <D> transformTypeArguments(transformer: FirTransformer<D>, data: D): FirFunctionCall
|
||||
|
||||
abstract override fun <D> transformCalleeReference(transformer: FirTransformer<D>, data: D): FirFunctionCall
|
||||
}
|
||||
|
||||
+6
-1
@@ -56,7 +56,7 @@ class FirComponentCallImpl(
|
||||
typeRef = typeRef.transformSingle(transformer, data)
|
||||
annotations.transformInplace(transformer, data)
|
||||
transformArguments(transformer, data)
|
||||
typeArguments.transformInplace(transformer, data)
|
||||
transformTypeArguments(transformer, data)
|
||||
transformCalleeReference(transformer, data)
|
||||
explicitReceiver = explicitReceiver.transformSingle(transformer, data)
|
||||
return this
|
||||
@@ -75,6 +75,11 @@ class FirComponentCallImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformTypeArguments(transformer: FirTransformer<D>, data: D): FirComponentCallImpl {
|
||||
typeArguments.transformInplace(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformCalleeReference(transformer: FirTransformer<D>, data: D): FirComponentCallImpl {
|
||||
calleeReference = calleeReference.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
+6
-1
@@ -60,7 +60,7 @@ class FirFunctionCallImpl(
|
||||
extensionReceiver = extensionReceiver.transformSingle(transformer, data)
|
||||
}
|
||||
transformArguments(transformer, data)
|
||||
typeArguments.transformInplace(transformer, data)
|
||||
transformTypeArguments(transformer, data)
|
||||
transformCalleeReference(transformer, data)
|
||||
return this
|
||||
}
|
||||
@@ -85,6 +85,11 @@ class FirFunctionCallImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformTypeArguments(transformer: FirTransformer<D>, data: D): FirFunctionCallImpl {
|
||||
typeArguments.transformInplace(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformCalleeReference(transformer: FirTransformer<D>, data: D): FirFunctionCallImpl {
|
||||
calleeReference = calleeReference.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
+4
-4
@@ -75,7 +75,7 @@ object NodeConfigurator : AbstractFieldConfigurator() {
|
||||
callableDeclaration.configure {
|
||||
withArg("F", "FirCallableDeclaration<F>")
|
||||
parentArg(symbolOwner, "E", "F")
|
||||
+field("receiverTypeRef", typeRef, nullable = true)
|
||||
+field("receiverTypeRef", typeRef, nullable = true).withTransform()
|
||||
+symbol("FirCallableSymbol", "F")
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ object NodeConfigurator : AbstractFieldConfigurator() {
|
||||
|
||||
memberDeclaration.configure {
|
||||
+typeParameters
|
||||
+status
|
||||
+status.withTransform()
|
||||
}
|
||||
|
||||
expression.configure {
|
||||
@@ -183,7 +183,7 @@ object NodeConfigurator : AbstractFieldConfigurator() {
|
||||
}
|
||||
|
||||
functionCall.configure {
|
||||
+typeArguments
|
||||
+typeArguments.withTransform()
|
||||
+field("calleeReference", namedReference)
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ object NodeConfigurator : AbstractFieldConfigurator() {
|
||||
+symbol("FirPropertyAccessorSymbol")
|
||||
+booleanField("isGetter")
|
||||
+booleanField("isSetter")
|
||||
+status
|
||||
+status.withTransform()
|
||||
+annotations
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ FILE fqName:<root> fileName:/localClassWithOverrides.kt
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[IrErrorType]
|
||||
CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[<root>.outer.ALocal]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.outer.Local
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.outer.Local [primary]
|
||||
BLOCK_BODY
|
||||
ERROR_CALL 'Cannot find delegated constructor call' type=<root>.outer.Local
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[IrErrorType]'
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.outer.ALocal'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[<root>.outer.ALocal]'
|
||||
FUN name:afun visibility:public modality:FINAL <> ($this:<root>.outer.Local) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.outer.Local
|
||||
BLOCK_BODY
|
||||
@@ -73,3 +73,16 @@ FILE fqName:<root> fileName:/localClassWithOverrides.kt
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.outer.Local declared in <root>.outer.Local.<set-avar>' type=<root>.outer.Local origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.outer.Local.<set-avar>' type=kotlin.Int origin=null
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
|
||||
@@ -4,21 +4,21 @@ FILE fqName:<root> fileName:/typeParameterClassLiteral.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun classRefFun <T> (): kotlin.reflect.KClass<IrErrorType> [inline] declared in <root>'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: T>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: R|?|' type=IrErrorType
|
||||
FUN name:classRefExtFun visibility:public modality:FINAL <T> ($receiver:kotlin.Any) returnType:kotlin.reflect.KClass<IrErrorType> [inline]
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[]
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun classRefExtFun <T> (): kotlin.reflect.KClass<IrErrorType> [inline] declared in <root>'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: T>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: R|?|' type=IrErrorType
|
||||
PROPERTY name:classRefExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-classRefExtVal> visibility:public modality:FINAL <> () returnType:kotlin.reflect.KClass<IrErrorType>
|
||||
correspondingProperty: PROPERTY name:classRefExtVal visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-classRefExtVal> (): kotlin.reflect.KClass<IrErrorType> declared in <root>'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: T>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: R|?|' type=IrErrorType
|
||||
CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Host
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Host [primary]
|
||||
@@ -31,7 +31,7 @@ FILE fqName:<root> fileName:/typeParameterClassLiteral.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberFun <TF> (): kotlin.reflect.KClass<IrErrorType> [inline] declared in <root>.Host'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: TF>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: R|?|' type=IrErrorType
|
||||
FUN name:classRefGenericMemberExtFun visibility:public modality:FINAL <TF> ($this:<root>.Host, $receiver:kotlin.Any) returnType:kotlin.reflect.KClass<IrErrorType> [inline]
|
||||
TYPE_PARAMETER name:TF index:0 variance: superTypes:[]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Host
|
||||
@@ -39,7 +39,7 @@ FILE fqName:<root> fileName:/typeParameterClassLiteral.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberExtFun <TF> (): kotlin.reflect.KClass<IrErrorType> [inline] declared in <root>.Host'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: TF>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: R|?|' type=IrErrorType
|
||||
PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val]
|
||||
FUN name:<get-classRefGenericMemberExtVal> visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.reflect.KClass<IrErrorType>
|
||||
correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val]
|
||||
@@ -47,7 +47,7 @@ FILE fqName:<root> fileName:/typeParameterClassLiteral.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-classRefGenericMemberExtVal> (): kotlin.reflect.KClass<IrErrorType> declared in <root>.Host'
|
||||
GET_CLASS type=kotlin.reflect.KClass<IrErrorType>
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: TV>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: R|?|' type=IrErrorType
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
|
||||
|
||||
Reference in New Issue
Block a user