[FIR] Implement super resolve as a particular tower resolver case
This commit is contained in:
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.references.FirSuperReference
|
|||||||
import org.jetbrains.kotlin.fir.references.FirThisReference
|
import org.jetbrains.kotlin.fir.references.FirThisReference
|
||||||
import org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext
|
import org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext
|
||||||
import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate
|
import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.calls.isSuperReferenceExpression
|
||||||
import org.jetbrains.kotlin.fir.resolve.diagnostics.FirUnresolvedNameError
|
import org.jetbrains.kotlin.fir.resolve.diagnostics.FirUnresolvedNameError
|
||||||
import org.jetbrains.kotlin.fir.resolve.substitution.AbstractConeSubstitutor
|
import org.jetbrains.kotlin.fir.resolve.substitution.AbstractConeSubstitutor
|
||||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
||||||
@@ -371,8 +372,10 @@ fun <T : FirResolvable> BodyResolveComponents.typeFromCallee(access: T): FirReso
|
|||||||
val receiverResultType = explicitReceiver.resultType
|
val receiverResultType = explicitReceiver.resultType
|
||||||
if (receiverResultType is FirResolvedTypeRef) {
|
if (receiverResultType is FirResolvedTypeRef) {
|
||||||
receiverResultType.type.isNullable
|
receiverResultType.type.isNullable
|
||||||
} else {
|
} else if (receiverResultType !is FirComposedSuperTypeRef || !explicitReceiver.isSuperReferenceExpression()){
|
||||||
throw AssertionError("Receiver ${explicitReceiver.render()} type is unresolved: ${receiverResultType.render()}")
|
throw AssertionError("Receiver ${explicitReceiver.render()} type is unresolved: ${receiverResultType.render()}")
|
||||||
|
} else {
|
||||||
|
false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
|
|||||||
+35
-3
@@ -13,17 +13,20 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedImportImpl
|
|||||||
import org.jetbrains.kotlin.fir.declarations.isCompanion
|
import org.jetbrains.kotlin.fir.declarations.isCompanion
|
||||||
import org.jetbrains.kotlin.fir.declarations.isInner
|
import org.jetbrains.kotlin.fir.declarations.isInner
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
||||||
|
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
||||||
import org.jetbrains.kotlin.fir.resolve.BodyResolveComponents
|
import org.jetbrains.kotlin.fir.resolve.BodyResolveComponents
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.scope
|
||||||
import org.jetbrains.kotlin.fir.resolve.transformers.ReturnTypeCalculator
|
import org.jetbrains.kotlin.fir.resolve.transformers.ReturnTypeCalculator
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||||
|
import org.jetbrains.kotlin.fir.scopes.impl.FirCompositeScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.FirExplicitSimpleImportingScope
|
import org.jetbrains.kotlin.fir.scopes.impl.FirExplicitSimpleImportingScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.FirLocalScope
|
import org.jetbrains.kotlin.fir.scopes.impl.FirLocalScope
|
||||||
import org.jetbrains.kotlin.fir.scopes.impl.FirStaticScope
|
import org.jetbrains.kotlin.fir.scopes.impl.FirStaticScope
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||||
import org.jetbrains.kotlin.fir.types.ConeIntegerLiteralType
|
import org.jetbrains.kotlin.fir.types.*
|
||||||
import org.jetbrains.kotlin.fir.types.coneTypeSafe
|
|
||||||
import org.jetbrains.kotlin.fir.types.impl.FirImplicitBuiltinTypeRef
|
import org.jetbrains.kotlin.fir.types.impl.FirImplicitBuiltinTypeRef
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
@@ -348,6 +351,27 @@ class FirTowerResolver(
|
|||||||
return collector
|
return collector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun runResolverForSuperReceiver(
|
||||||
|
info: CallInfo,
|
||||||
|
collector: CandidateCollector,
|
||||||
|
superTypeRef: FirTypeRef,
|
||||||
|
manager: TowerResolveManager
|
||||||
|
): CandidateCollector {
|
||||||
|
val scope = when (superTypeRef) {
|
||||||
|
is FirResolvedTypeRef -> superTypeRef.type.scope(session, components.scopeSession)
|
||||||
|
is FirComposedSuperTypeRef -> FirCompositeScope(
|
||||||
|
superTypeRef.superTypeRefs.mapNotNullTo(mutableListOf()) { it.type.scope(session, components.scopeSession) }
|
||||||
|
)
|
||||||
|
else -> null
|
||||||
|
} ?: return collector
|
||||||
|
manager.processLevel(
|
||||||
|
ScopeTowerLevel(
|
||||||
|
session, components, scope
|
||||||
|
), info, TowerGroup.Member, explicitReceiverKind = ExplicitReceiverKind.DISPATCH_RECEIVER
|
||||||
|
)
|
||||||
|
return collector
|
||||||
|
}
|
||||||
|
|
||||||
internal fun enqueueResolverForInvoke(
|
internal fun enqueueResolverForInvoke(
|
||||||
info: CallInfo,
|
info: CallInfo,
|
||||||
invokeReceiverValue: ExpressionReceiverValue,
|
invokeReceiverValue: ExpressionReceiverValue,
|
||||||
@@ -459,7 +483,15 @@ class FirTowerResolver(
|
|||||||
return when (val receiver = info.explicitReceiver) {
|
return when (val receiver = info.explicitReceiver) {
|
||||||
is FirResolvedQualifier -> runResolverForQualifierReceiver(info, collector, receiver, manager)
|
is FirResolvedQualifier -> runResolverForQualifierReceiver(info, collector, receiver, manager)
|
||||||
null -> runResolverForNoReceiver(info, collector, manager)
|
null -> runResolverForNoReceiver(info, collector, manager)
|
||||||
else -> runResolverForExpressionReceiver(info, collector, receiver, manager)
|
else -> {
|
||||||
|
if (receiver is FirQualifiedAccessExpression) {
|
||||||
|
val calleeReference = receiver.calleeReference
|
||||||
|
if (calleeReference is FirSuperReference) {
|
||||||
|
return runResolverForSuperReceiver(info, collector, receiver.typeRef, manager)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
runResolverForExpressionReceiver(info, collector, receiver, manager)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ package org.jetbrains.kotlin.fir.resolve.calls
|
|||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.*
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression
|
||||||
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
||||||
|
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
||||||
import org.jetbrains.kotlin.fir.render
|
import org.jetbrains.kotlin.fir.render
|
||||||
import org.jetbrains.kotlin.fir.resolve.*
|
import org.jetbrains.kotlin.fir.resolve.*
|
||||||
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
||||||
@@ -33,6 +36,13 @@ abstract class ResolutionStage {
|
|||||||
|
|
||||||
abstract class CheckerStage : ResolutionStage()
|
abstract class CheckerStage : ResolutionStage()
|
||||||
|
|
||||||
|
internal fun FirExpression.isSuperReferenceExpression(): Boolean {
|
||||||
|
return if (this is FirQualifiedAccessExpression) {
|
||||||
|
val calleeReference = calleeReference
|
||||||
|
calleeReference is FirSuperReference
|
||||||
|
} else false
|
||||||
|
}
|
||||||
|
|
||||||
internal object CheckExplicitReceiverConsistency : ResolutionStage() {
|
internal object CheckExplicitReceiverConsistency : ResolutionStage() {
|
||||||
override suspend fun check(candidate: Candidate, sink: CheckerSink, callInfo: CallInfo) {
|
override suspend fun check(candidate: Candidate, sink: CheckerSink, callInfo: CallInfo) {
|
||||||
val receiverKind = candidate.explicitReceiverKind
|
val receiverKind = candidate.explicitReceiverKind
|
||||||
@@ -40,7 +50,7 @@ internal object CheckExplicitReceiverConsistency : ResolutionStage() {
|
|||||||
// TODO: add invoke cases
|
// TODO: add invoke cases
|
||||||
when (receiverKind) {
|
when (receiverKind) {
|
||||||
NO_EXPLICIT_RECEIVER -> {
|
NO_EXPLICIT_RECEIVER -> {
|
||||||
if (explicitReceiver != null && explicitReceiver !is FirResolvedQualifier) {
|
if (explicitReceiver != null && explicitReceiver !is FirResolvedQualifier && !explicitReceiver.isSuperReferenceExpression()) {
|
||||||
return sink.yieldApplicability(CandidateApplicability.WRONG_RECEIVER)
|
return sink.yieldApplicability(CandidateApplicability.WRONG_RECEIVER)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,7 +116,10 @@ internal sealed class CheckReceivers : ResolutionStage() {
|
|||||||
val explicitReceiverKind = candidate.explicitReceiverKind
|
val explicitReceiverKind = candidate.explicitReceiverKind
|
||||||
|
|
||||||
if (expectedReceiverType != null) {
|
if (expectedReceiverType != null) {
|
||||||
if (explicitReceiverExpression != null && explicitReceiverKind.shouldBeCheckedAgainstExplicit()) {
|
if (explicitReceiverExpression != null &&
|
||||||
|
explicitReceiverKind.shouldBeCheckedAgainstExplicit() &&
|
||||||
|
!explicitReceiverExpression.isSuperReferenceExpression()
|
||||||
|
) {
|
||||||
candidate.resolveArgumentExpression(
|
candidate.resolveArgumentExpression(
|
||||||
candidate.csBuilder,
|
candidate.csBuilder,
|
||||||
argument = explicitReceiverExpression,
|
argument = explicitReceiverExpression,
|
||||||
|
|||||||
+18
-7
@@ -89,13 +89,24 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
|
|||||||
qualifiedAccessExpression.resultType = callee.superTypeRef
|
qualifiedAccessExpression.resultType = callee.superTypeRef
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
val superTypeRefFromStack = implicitReceiverStack.lastDispatchReceiver()
|
val superTypeRefs = implicitReceiverStack.lastDispatchReceiver()?.boundSymbol?.phasedFir?.superTypeRefs
|
||||||
?.boundSymbol?.phasedFir?.superTypeRefs?.firstOrNull()
|
val resultType = when {
|
||||||
?: FirErrorTypeRefImpl(
|
superTypeRefs?.isNotEmpty() != true -> {
|
||||||
qualifiedAccessExpression.source, FirSimpleDiagnostic("No super type", DiagnosticKind.NoSupertype)
|
FirErrorTypeRefImpl(
|
||||||
)
|
qualifiedAccessExpression.source, FirSimpleDiagnostic("No super type", DiagnosticKind.NoSupertype)
|
||||||
qualifiedAccessExpression.resultType = superTypeRefFromStack
|
)
|
||||||
callee.replaceSuperTypeRef(superTypeRefFromStack)
|
}
|
||||||
|
superTypeRefs.size == 1 -> {
|
||||||
|
superTypeRefs.single()
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
FirComposedSuperTypeRefImpl(qualifiedAccessExpression.source).apply {
|
||||||
|
this.superTypeRefs += superTypeRefs.map { it as FirResolvedTypeRef }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qualifiedAccessExpression.resultType = resultType
|
||||||
|
callee.replaceSuperTypeRef(resultType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qualifiedAccessExpression
|
qualifiedAccessExpression
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ open class B {
|
|||||||
|
|
||||||
class C : A, B() {
|
class C : A, B() {
|
||||||
override fun foo() {
|
override fun foo() {
|
||||||
super.<!UNRESOLVED_REFERENCE!>foo<!>()
|
super.foo()
|
||||||
|
|
||||||
super.bar() // should be ambiguity
|
super.<!AMBIGUITY!>bar<!>() // should be ambiguity (NB: really we should have overridden bar in C)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ FILE: incorrectSuperCall.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final override fun foo(): R|kotlin/Unit| {
|
public final override fun foo(): R|kotlin/Unit| {
|
||||||
super<R|A|>.<Unresolved name: foo>#()
|
super<R|A|R|B|>.R|/B.foo|()
|
||||||
super<R|A|>.R|/A.bar|()
|
super<R|A|R|B|>.<Ambiguity: bar, [/A.bar, /B.bar]>#()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,6 +268,8 @@ class FirResolveBench(val withProgress: Boolean) {
|
|||||||
visitTypeRef(implicitTypeRef)
|
visitTypeRef(implicitTypeRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visitComposedSuperTypeRef(composedSuperTypeRef: FirComposedSuperTypeRef) {}
|
||||||
|
|
||||||
override fun visitResolvedTypeRef(resolvedTypeRef: FirResolvedTypeRef) {
|
override fun visitResolvedTypeRef(resolvedTypeRef: FirResolvedTypeRef) {
|
||||||
resolvedTypes++
|
resolvedTypes++
|
||||||
val type = resolvedTypeRef.type
|
val type = resolvedTypeRef.type
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2020 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.types
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.fir.FirPureAbstractElement
|
||||||
|
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||||
|
import org.jetbrains.kotlin.fir.visitors.*
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file was generated automatically
|
||||||
|
* DO NOT MODIFY IT MANUALLY
|
||||||
|
*/
|
||||||
|
|
||||||
|
abstract class FirComposedSuperTypeRef : FirPureAbstractElement(), FirTypeRef {
|
||||||
|
abstract override val source: FirSourceElement?
|
||||||
|
abstract override val annotations: List<FirAnnotationCall>
|
||||||
|
abstract val superTypeRefs: List<FirResolvedTypeRef>
|
||||||
|
|
||||||
|
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitComposedSuperTypeRef(this, data)
|
||||||
|
}
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2020 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.types.impl
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||||
|
import org.jetbrains.kotlin.fir.impl.FirAbstractAnnotatedElement
|
||||||
|
import org.jetbrains.kotlin.fir.types.FirComposedSuperTypeRef
|
||||||
|
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef
|
||||||
|
import org.jetbrains.kotlin.fir.visitors.*
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file was generated automatically
|
||||||
|
* DO NOT MODIFY IT MANUALLY
|
||||||
|
*/
|
||||||
|
|
||||||
|
class FirComposedSuperTypeRefImpl(
|
||||||
|
override val source: FirSourceElement?
|
||||||
|
) : FirComposedSuperTypeRef(), FirAbstractAnnotatedElement {
|
||||||
|
override val annotations: MutableList<FirAnnotationCall> = mutableListOf()
|
||||||
|
override val superTypeRefs: MutableList<FirResolvedTypeRef> = mutableListOf()
|
||||||
|
|
||||||
|
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
|
||||||
|
annotations.forEach { it.accept(visitor, data) }
|
||||||
|
superTypeRefs.forEach { it.accept(visitor, data) }
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirComposedSuperTypeRefImpl {
|
||||||
|
annotations.transformInplace(transformer, data)
|
||||||
|
superTypeRefs.transformInplace(transformer, data)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -116,6 +116,7 @@ import org.jetbrains.kotlin.fir.types.FirDynamicTypeRef
|
|||||||
import org.jetbrains.kotlin.fir.types.FirFunctionTypeRef
|
import org.jetbrains.kotlin.fir.types.FirFunctionTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.FirResolvedFunctionTypeRef
|
import org.jetbrains.kotlin.fir.types.FirResolvedFunctionTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||||
|
import org.jetbrains.kotlin.fir.types.FirComposedSuperTypeRef
|
||||||
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
|
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
|
||||||
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult
|
||||||
|
|
||||||
@@ -568,6 +569,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
|
|||||||
return transformElement(implicitTypeRef, data)
|
return transformElement(implicitTypeRef, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun transformComposedSuperTypeRef(composedSuperTypeRef: FirComposedSuperTypeRef, data: D): CompositeTransformResult<FirTypeRef> {
|
||||||
|
return transformElement(composedSuperTypeRef, data)
|
||||||
|
}
|
||||||
|
|
||||||
open fun transformContractDescription(contractDescription: FirContractDescription, data: D): CompositeTransformResult<FirContractDescription> {
|
open fun transformContractDescription(contractDescription: FirContractDescription, data: D): CompositeTransformResult<FirContractDescription> {
|
||||||
return transformElement(contractDescription, data)
|
return transformElement(contractDescription, data)
|
||||||
}
|
}
|
||||||
@@ -1016,6 +1021,10 @@ abstract class FirTransformer<in D> : FirVisitor<CompositeTransformResult<FirEle
|
|||||||
return transformImplicitTypeRef(implicitTypeRef, data)
|
return transformImplicitTypeRef(implicitTypeRef, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final override fun visitComposedSuperTypeRef(composedSuperTypeRef: FirComposedSuperTypeRef, data: D): CompositeTransformResult<FirTypeRef> {
|
||||||
|
return transformComposedSuperTypeRef(composedSuperTypeRef, data)
|
||||||
|
}
|
||||||
|
|
||||||
final override fun visitContractDescription(contractDescription: FirContractDescription, data: D): CompositeTransformResult<FirContractDescription> {
|
final override fun visitContractDescription(contractDescription: FirContractDescription, data: D): CompositeTransformResult<FirContractDescription> {
|
||||||
return transformContractDescription(contractDescription, data)
|
return transformContractDescription(contractDescription, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ import org.jetbrains.kotlin.fir.types.FirDynamicTypeRef
|
|||||||
import org.jetbrains.kotlin.fir.types.FirFunctionTypeRef
|
import org.jetbrains.kotlin.fir.types.FirFunctionTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.FirResolvedFunctionTypeRef
|
import org.jetbrains.kotlin.fir.types.FirResolvedFunctionTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||||
|
import org.jetbrains.kotlin.fir.types.FirComposedSuperTypeRef
|
||||||
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
|
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -346,6 +347,8 @@ abstract class FirVisitor<out R, in D> {
|
|||||||
|
|
||||||
open fun visitImplicitTypeRef(implicitTypeRef: FirImplicitTypeRef, data: D): R = visitElement(implicitTypeRef, data)
|
open fun visitImplicitTypeRef(implicitTypeRef: FirImplicitTypeRef, data: D): R = visitElement(implicitTypeRef, data)
|
||||||
|
|
||||||
|
open fun visitComposedSuperTypeRef(composedSuperTypeRef: FirComposedSuperTypeRef, data: D): R = visitElement(composedSuperTypeRef, data)
|
||||||
|
|
||||||
open fun visitContractDescription(contractDescription: FirContractDescription, data: D): R = visitElement(contractDescription, data)
|
open fun visitContractDescription(contractDescription: FirContractDescription, data: D): R = visitElement(contractDescription, data)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ import org.jetbrains.kotlin.fir.types.FirDynamicTypeRef
|
|||||||
import org.jetbrains.kotlin.fir.types.FirFunctionTypeRef
|
import org.jetbrains.kotlin.fir.types.FirFunctionTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.FirResolvedFunctionTypeRef
|
import org.jetbrains.kotlin.fir.types.FirResolvedFunctionTypeRef
|
||||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||||
|
import org.jetbrains.kotlin.fir.types.FirComposedSuperTypeRef
|
||||||
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
|
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -566,6 +567,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
|||||||
visitElement(implicitTypeRef)
|
visitElement(implicitTypeRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun visitComposedSuperTypeRef(composedSuperTypeRef: FirComposedSuperTypeRef) {
|
||||||
|
visitElement(composedSuperTypeRef)
|
||||||
|
}
|
||||||
|
|
||||||
open fun visitContractDescription(contractDescription: FirContractDescription) {
|
open fun visitContractDescription(contractDescription: FirContractDescription) {
|
||||||
visitElement(contractDescription)
|
visitElement(contractDescription)
|
||||||
}
|
}
|
||||||
@@ -1014,6 +1019,10 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
|||||||
visitImplicitTypeRef(implicitTypeRef)
|
visitImplicitTypeRef(implicitTypeRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final override fun visitComposedSuperTypeRef(composedSuperTypeRef: FirComposedSuperTypeRef, data: Nothing?) {
|
||||||
|
visitComposedSuperTypeRef(composedSuperTypeRef)
|
||||||
|
}
|
||||||
|
|
||||||
final override fun visitContractDescription(contractDescription: FirContractDescription, data: Nothing?) {
|
final override fun visitContractDescription(contractDescription: FirContractDescription, data: Nothing?) {
|
||||||
visitContractDescription(contractDescription)
|
visitContractDescription(contractDescription)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -137,6 +137,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
|||||||
val functionTypeRef = element("FunctionTypeRef", TypeRef, typeRefWithNullability)
|
val functionTypeRef = element("FunctionTypeRef", TypeRef, typeRefWithNullability)
|
||||||
val resolvedFunctionTypeRef = element("ResolvedFunctionTypeRef", TypeRef, resolvedTypeRef, functionTypeRef)
|
val resolvedFunctionTypeRef = element("ResolvedFunctionTypeRef", TypeRef, resolvedTypeRef, functionTypeRef)
|
||||||
val implicitTypeRef = element("ImplicitTypeRef", TypeRef, typeRef)
|
val implicitTypeRef = element("ImplicitTypeRef", TypeRef, typeRef)
|
||||||
|
val composedSuperTypeRef = element("ComposedSuperTypeRef", TypeRef, typeRef)
|
||||||
|
|
||||||
val contractDescription = element("ContractDescription", Contracts)
|
val contractDescription = element("ContractDescription", Contracts)
|
||||||
}
|
}
|
||||||
+2
@@ -513,6 +513,8 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
|||||||
defaultEmptyList("annotations")
|
defaultEmptyList("annotations")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl(composedSuperTypeRef)
|
||||||
|
|
||||||
impl(reference, "FirStubReference") {
|
impl(reference, "FirStubReference") {
|
||||||
default("source") {
|
default("source") {
|
||||||
value = "null"
|
value = "null"
|
||||||
|
|||||||
+4
@@ -521,6 +521,10 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
|||||||
+returnTypeRef
|
+returnTypeRef
|
||||||
}
|
}
|
||||||
|
|
||||||
|
composedSuperTypeRef.configure {
|
||||||
|
+fieldList("superTypeRefs", resolvedTypeRef)
|
||||||
|
}
|
||||||
|
|
||||||
thisReceiverExpression.configure {
|
thisReceiverExpression.configure {
|
||||||
+field("calleeReference", thisReference)
|
+field("calleeReference", thisReference)
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS_IR
|
// IGNORE_BACKEND: JS_IR
|
||||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||||
// IGNORE_BACKEND: JS, NATIVE
|
// IGNORE_BACKEND: JS, NATIVE
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
open class A : Cloneable {
|
open class A : Cloneable {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// !JVM_DEFAULT_MODE: enable
|
// !JVM_DEFAULT_MODE: enable
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// JVM_TARGET: 1.8
|
// JVM_TARGET: 1.8
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// JVM_TARGET: 1.8
|
// JVM_TARGET: 1.8
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
open class A {
|
open class A {
|
||||||
internal open val field = "F"
|
internal open val field = "F"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
open class A {
|
open class A {
|
||||||
internal open val field = "F"
|
internal open val field = "F"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
interface Z<T> {
|
interface Z<T> {
|
||||||
val value: T
|
val value: T
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
enum class E : Cloneable {
|
enum class E : Cloneable {
|
||||||
A;
|
A;
|
||||||
override fun clone(): Any {
|
override fun clone(): Any {
|
||||||
return super.clone()
|
return super.<!AMBIGUITY!>clone<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -14,9 +14,9 @@ class C : T {
|
|||||||
fun T.buzz() {}
|
fun T.buzz() {}
|
||||||
fun T.buzz1() {}
|
fun T.buzz1() {}
|
||||||
super.foo() // OK
|
super.foo() // OK
|
||||||
super.bar() // Error
|
super.<!UNRESOLVED_REFERENCE!>bar<!>() // Error
|
||||||
super.buzz() // OK, resolved to a member
|
super.buzz() // OK, resolved to a member
|
||||||
super.buzz1() // Resolved to an extension
|
super.<!INAPPLICABLE_CANDIDATE!>buzz1<!>() // Resolved to an extension
|
||||||
super.<!INAPPLICABLE_CANDIDATE!>buzz1<!>("") // Resolved to a member
|
super.<!INAPPLICABLE_CANDIDATE!>buzz1<!>("") // Resolved to a member
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ class A<E>() : C(), T {
|
|||||||
fun test() {
|
fun test() {
|
||||||
super
|
super
|
||||||
super<T>
|
super<T>
|
||||||
super.<!UNRESOLVED_REFERENCE!>foo<!>()
|
super.foo()
|
||||||
super<T>.foo()
|
super<T>.foo()
|
||||||
super<C>.bar()
|
super<C>.bar()
|
||||||
super<T>@A.foo()
|
super<T>@A.foo()
|
||||||
|
|||||||
+1
-1
@@ -4,6 +4,6 @@ fun Any.extension(arg: Any?) {}
|
|||||||
|
|
||||||
class A1 {
|
class A1 {
|
||||||
fun test() {
|
fun test() {
|
||||||
super.extension(null) // Call to an extension function
|
super.<!UNRESOLVED_REFERENCE!>extension<!>(null) // Call to an extension function
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+6
-6
@@ -11,28 +11,28 @@ interface GenericBaseInterface<T> {
|
|||||||
|
|
||||||
class GenericDerivedClass<T> : GenericBaseClass<T>(), GenericBaseInterface<T> {
|
class GenericDerivedClass<T> : GenericBaseClass<T>(), GenericBaseInterface<T> {
|
||||||
override fun foo(x: T): T = super.foo(x)
|
override fun foo(x: T): T = super.foo(x)
|
||||||
override fun bar(x: T): T = super.<!UNRESOLVED_REFERENCE!>bar<!>(x)
|
override fun bar(x: T): T = super.bar(x)
|
||||||
|
|
||||||
override fun ambiguous(x: T): T =
|
override fun ambiguous(x: T): T =
|
||||||
super.ambiguous(x)
|
super.<!AMBIGUITY!>ambiguous<!>(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
class SpecializedDerivedClass : GenericBaseClass<Int>(), GenericBaseInterface<String> {
|
class SpecializedDerivedClass : GenericBaseClass<Int>(), GenericBaseInterface<String> {
|
||||||
override fun foo(x: Int): Int = super.foo(x)
|
override fun foo(x: Int): Int = super.foo(x)
|
||||||
override fun bar(x: String): String = super.<!UNRESOLVED_REFERENCE!>bar<!>(x)
|
override fun bar(x: String): String = super.bar(x)
|
||||||
|
|
||||||
override fun ambiguous(x: String): String =
|
override fun ambiguous(x: String): String =
|
||||||
super.<!INAPPLICABLE_CANDIDATE!>ambiguous<!>(x)
|
super.ambiguous(x)
|
||||||
override fun ambiguous(x: Int): Int =
|
override fun ambiguous(x: Int): Int =
|
||||||
super.ambiguous(x)
|
super.ambiguous(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
class MixedDerivedClass<T> : GenericBaseClass<Int>(), GenericBaseInterface<T> {
|
class MixedDerivedClass<T> : GenericBaseClass<Int>(), GenericBaseInterface<T> {
|
||||||
override fun foo(x: Int): Int = super.foo(x)
|
override fun foo(x: Int): Int = super.foo(x)
|
||||||
override fun bar(x: T): T = super.<!UNRESOLVED_REFERENCE!>bar<!>(x)
|
override fun bar(x: T): T = super.bar(x)
|
||||||
|
|
||||||
override fun ambiguous(x: Int): Int =
|
override fun ambiguous(x: Int): Int =
|
||||||
super.ambiguous(x)
|
super.ambiguous(x)
|
||||||
override fun ambiguous(x: T): T =
|
override fun ambiguous(x: T): T =
|
||||||
super.<!INAPPLICABLE_CANDIDATE!>ambiguous<!>(x)
|
super.ambiguous(x)
|
||||||
}
|
}
|
||||||
+3
-3
@@ -45,13 +45,13 @@ class Derived : Base(), Interface {
|
|||||||
super.prop
|
super.prop
|
||||||
|
|
||||||
fun getAmbiguousSuperProp(): Int =
|
fun getAmbiguousSuperProp(): Int =
|
||||||
super.ambiguousProp
|
super.<!AMBIGUITY!>ambiguousProp<!>
|
||||||
|
|
||||||
fun callsFunFromSuperInterface() {
|
fun callsFunFromSuperInterface() {
|
||||||
super.<!UNRESOLVED_REFERENCE!>bar<!>()
|
super.bar()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun callsAmbiguousSuperFun() {
|
fun callsAmbiguousSuperFun() {
|
||||||
super.ambiguous()
|
super.<!AMBIGUITY!>ambiguous<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -22,18 +22,18 @@ interface I {
|
|||||||
|
|
||||||
class B : A(), I {
|
class B : A(), I {
|
||||||
override val x: Int = 12345
|
override val x: Int = 12345
|
||||||
override val y: Int = super.y
|
override val y: Int = super.<!AMBIGUITY!>y<!>
|
||||||
|
|
||||||
override fun foo(): Int {
|
override fun foo(): Int {
|
||||||
super.foo()
|
super.foo()
|
||||||
return super.<!UNRESOLVED_REFERENCE!>x<!>
|
return super.x
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun bar() {
|
override fun bar() {
|
||||||
super.bar()
|
super.<!AMBIGUITY!>bar<!>()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun qux() {
|
override fun qux() {
|
||||||
super.qux()
|
super.<!AMBIGUITY!>qux<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -43,8 +43,8 @@ class DeepDerived : DeepBase(), DeepInterface {
|
|||||||
super.deeperBaseProp
|
super.deeperBaseProp
|
||||||
|
|
||||||
fun callsSuperInterfaceFuns() {
|
fun callsSuperInterfaceFuns() {
|
||||||
super.<!UNRESOLVED_REFERENCE!>deeperInterfaceFun<!>()
|
super.deeperInterfaceFun()
|
||||||
super.<!UNRESOLVED_REFERENCE!>deepInterfaceFun<!>()
|
super.deepInterfaceFun()
|
||||||
super<DeepInterface>.deeperInterfaceFun()
|
super<DeepInterface>.deeperInterfaceFun()
|
||||||
super<DeepInterface>.deepInterfaceFun()
|
super<DeepInterface>.deepInterfaceFun()
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -8,15 +8,15 @@ interface GenericBaseInterface<T> {
|
|||||||
|
|
||||||
class GenericDerivedClass<T> : GenericBaseClass<T>(), GenericBaseInterface<T> {
|
class GenericDerivedClass<T> : GenericBaseClass<T>(), GenericBaseInterface<T> {
|
||||||
override fun foo(x: T): T = super.foo(x)
|
override fun foo(x: T): T = super.foo(x)
|
||||||
override fun bar(x: T): T = super.<!UNRESOLVED_REFERENCE!>bar<!>(x)
|
override fun bar(x: T): T = super.bar(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
class SpecializedDerivedClass : GenericBaseClass<Int>(), GenericBaseInterface<String> {
|
class SpecializedDerivedClass : GenericBaseClass<Int>(), GenericBaseInterface<String> {
|
||||||
override fun foo(x: Int): Int = super.foo(x)
|
override fun foo(x: Int): Int = super.foo(x)
|
||||||
override fun bar(x: String): String = super.<!UNRESOLVED_REFERENCE!>bar<!>(x)
|
override fun bar(x: String): String = super.bar(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
class MixedDerivedClass<T> : GenericBaseClass<Int>(), GenericBaseInterface<T> {
|
class MixedDerivedClass<T> : GenericBaseClass<Int>(), GenericBaseInterface<T> {
|
||||||
override fun foo(x: Int): Int = super.foo(x)
|
override fun foo(x: Int): Int = super.foo(x)
|
||||||
override fun bar(x: T): T = super.<!UNRESOLVED_REFERENCE!>bar<!>(x)
|
override fun bar(x: T): T = super.bar(x)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -16,7 +16,7 @@ class C : A(), B {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun bar() {
|
override fun bar() {
|
||||||
super@C.<!UNRESOLVED_REFERENCE!>bar<!>()
|
super@C.bar()
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class D : A(), Q {
|
inner class D : A(), Q {
|
||||||
@@ -26,8 +26,8 @@ class C : A(), B {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun qux() {
|
override fun qux() {
|
||||||
super@C.<!UNRESOLVED_REFERENCE!>qux<!>()
|
super@C.qux()
|
||||||
super@D.<!UNRESOLVED_REFERENCE!>qux<!>()
|
super@D.qux()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -20,9 +20,9 @@ interface AnotherInterface {
|
|||||||
interface DerivedInterface: Interface, AnotherInterface {
|
interface DerivedInterface: Interface, AnotherInterface {
|
||||||
override fun foo() { super.foo() }
|
override fun foo() { super.foo() }
|
||||||
override fun ambiguous() {
|
override fun ambiguous() {
|
||||||
super.ambiguous()
|
super.<!AMBIGUITY!>ambiguous<!>()
|
||||||
}
|
}
|
||||||
override val ambiguousProp: Int
|
override val ambiguousProp: Int
|
||||||
get() = super.ambiguousProp
|
get() = super.<!AMBIGUITY!>ambiguousProp<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -41,13 +41,13 @@ class ClassDerivedFromUnresolved : Base(), Interface, Unresolved {
|
|||||||
super.prop
|
super.prop
|
||||||
|
|
||||||
fun getAmbiguousSuperProp(): Int =
|
fun getAmbiguousSuperProp(): Int =
|
||||||
super.ambiguousProp
|
super.<!AMBIGUITY!>ambiguousProp<!>
|
||||||
|
|
||||||
fun callsFunFromSuperInterface() {
|
fun callsFunFromSuperInterface() {
|
||||||
super.<!UNRESOLVED_REFERENCE!>bar<!>()
|
super.bar()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun callsAmbiguousSuperFun() {
|
fun callsAmbiguousSuperFun() {
|
||||||
super.ambiguous()
|
super.<!AMBIGUITY!>ambiguous<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@ class Test1 : C(), A {
|
|||||||
// Abstract 'foo' defined in 'C' wins against non-abstract 'foo' defined in 'A',
|
// Abstract 'foo' defined in 'C' wins against non-abstract 'foo' defined in 'A',
|
||||||
// because 'C' is a subclass of 'A' (and 'C::foo' overrides 'A::foo'),
|
// because 'C' is a subclass of 'A' (and 'C::foo' overrides 'A::foo'),
|
||||||
// even though 'A' is explicitly listed in supertypes list for 'D'.
|
// even though 'A' is explicitly listed in supertypes list for 'D'.
|
||||||
super.foo()
|
super.<!AMBIGUITY!>foo<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ class Test2 : C(), A, Unrelated {
|
|||||||
override fun foo() {
|
override fun foo() {
|
||||||
// This is ok, because there's a non-abstract 'foo' in 'Unrelated',
|
// This is ok, because there's a non-abstract 'foo' in 'Unrelated',
|
||||||
// which is not overridden by abstract 'foo' in 'C'.
|
// which is not overridden by abstract 'foo' in 'C'.
|
||||||
super.foo()
|
super.<!AMBIGUITY!>foo<!>()
|
||||||
super<Unrelated>.foo()
|
super<Unrelated>.foo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -49,7 +49,7 @@ class ManySupers2: Foo2(), C {
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
super<Foo2>.test()
|
super<Foo2>.test()
|
||||||
super<C>.test()
|
super<C>.test()
|
||||||
super.test()
|
super.<!AMBIGUITY!>test<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +57,6 @@ class ManySupers3: Bar2(), C {
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
super<Bar2>.test()
|
super<Bar2>.test()
|
||||||
super<C>.test()
|
super<C>.test()
|
||||||
super.test()
|
super.<!AMBIGUITY!>test<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
abstract class A : MutableList<String> {
|
abstract class A : MutableList<String> {
|
||||||
override fun sort(/*0*/ p0: java.util.Comparator<in String>) {
|
override fun sort(/*0*/ p0: java.util.Comparator<in String>) {
|
||||||
super.sort(p0)
|
super.<!UNRESOLVED_REFERENCE!>sort<!>(p0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
|
|||||||
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in <root>.A.Y'
|
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in <root>.A.Y'
|
||||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=null
|
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=null
|
||||||
$this: CALL 'public open fun f (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
$this: CALL 'public open fun f (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||||
$this: ERROR_CALL 'Unresolved reference: super<R|A|>' type=<root>.A
|
$this: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
|
||||||
other: CONST String type=kotlin.String value="#Y"
|
other: CONST String type=kotlin.String value="#Y"
|
||||||
ENUM_ENTRY name:Z
|
ENUM_ENTRY name:Z
|
||||||
class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:local superTypes:[<root>.A]
|
class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:local superTypes:[<root>.A]
|
||||||
|
|||||||
+5
-5
@@ -50,7 +50,7 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.K2'
|
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.K2'
|
||||||
CALL 'public open fun foo (): kotlin.String [operator] declared in <root>.JFoo' type=kotlin.String origin=null
|
CALL 'public open fun foo (): kotlin.String [operator] declared in <root>.JFoo' type=kotlin.String origin=null
|
||||||
$this: ERROR_CALL 'Unresolved reference: super<R|JFoo|>' type=<root>.JFoo
|
$this: GET_VAR '<this>: <root>.K2 declared in <root>.K2.foo' type=<root>.K2 origin=null
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||||
overridden:
|
overridden:
|
||||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||||
@@ -93,12 +93,12 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
|
||||||
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K4) returnType:kotlin.String?
|
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K4) returnType:kotlin.String
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.K4
|
$this: VALUE_PARAMETER name:<this> type:<root>.K4
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String? declared in <root>.K4'
|
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.K4'
|
||||||
CALL 'public open fun foo (): kotlin.String? [operator] declared in <root>.JUnrelatedFoo' type=kotlin.String? origin=null
|
CALL 'public abstract fun foo (): kotlin.String declared in <root>.IFoo' type=kotlin.String origin=null
|
||||||
$this: ERROR_CALL 'Unresolved reference: super<R|JUnrelatedFoo|>' type=<root>.JUnrelatedFoo
|
$this: GET_VAR '<this>: <root>.K4 declared in <root>.K4.foo' type=<root>.K4 origin=null
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||||
overridden:
|
overridden:
|
||||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||||
|
|||||||
+3
-3
@@ -24,7 +24,7 @@ FILE fqName:<root> fileName:/superCalls.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Base'
|
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Base'
|
||||||
CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
|
CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
|
||||||
$this: ERROR_CALL 'Unresolved reference: super<R|kotlin/Any|>' type=kotlin.Any
|
$this: GET_VAR '<this>: <root>.Base declared in <root>.Base.hashCode' type=<root>.Base origin=null
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||||
overridden:
|
overridden:
|
||||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||||
@@ -44,7 +44,7 @@ FILE fqName:<root> fileName:/superCalls.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Derived
|
$this: VALUE_PARAMETER name:<this> type:<root>.Derived
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public open fun foo (): kotlin.Unit declared in <root>.Base' type=kotlin.Unit origin=null
|
CALL 'public open fun foo (): kotlin.Unit declared in <root>.Base' type=kotlin.Unit origin=null
|
||||||
$this: ERROR_CALL 'Unresolved reference: super<R|Base|>' type=<root>.Base
|
$this: GET_VAR '<this>: <root>.Derived declared in <root>.Derived.foo' type=<root>.Derived origin=null
|
||||||
PROPERTY name:bar visibility:public modality:FINAL [val]
|
PROPERTY name:bar visibility:public modality:FINAL [val]
|
||||||
FUN name:<get-bar> visibility:public modality:FINAL <> ($this:<root>.Derived) returnType:kotlin.String
|
FUN name:<get-bar> visibility:public modality:FINAL <> ($this:<root>.Derived) returnType:kotlin.String
|
||||||
correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val]
|
correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val]
|
||||||
@@ -52,7 +52,7 @@ FILE fqName:<root> fileName:/superCalls.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun <get-bar> (): kotlin.String declared in <root>.Derived'
|
RETURN type=kotlin.Nothing from='public final fun <get-bar> (): kotlin.String declared in <root>.Derived'
|
||||||
CALL 'public open fun <get-bar> (): kotlin.String declared in <root>.Base' type=kotlin.String origin=null
|
CALL 'public open fun <get-bar> (): kotlin.String declared in <root>.Base' type=kotlin.String origin=null
|
||||||
$this: ERROR_CALL 'Unresolved reference: super<R|Base|>' type=<root>.Base
|
$this: GET_VAR '<this>: <root>.Derived declared in <root>.Derived.<get-bar>' type=<root>.Derived origin=null
|
||||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:<root>.Base) returnType:kotlin.Int [fake_override]
|
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:<root>.Base) returnType:kotlin.Int [fake_override]
|
||||||
overridden:
|
overridden:
|
||||||
public open fun hashCode (): kotlin.Int declared in <root>.Base
|
public open fun hashCode (): kotlin.Int declared in <root>.Base
|
||||||
|
|||||||
Reference in New Issue
Block a user