[FE] Add context receivers to scope
This commit is contained in:
committed by
TeamCityServer
parent
c5687e080d
commit
d923c95671
+6
@@ -10471,6 +10471,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/classObject.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/classObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("contextReceiver.kt")
|
||||||
|
public void testContextReceiver() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ExtensionFunctions.kt")
|
@TestMetadata("ExtensionFunctions.kt")
|
||||||
public void testExtensionFunctions() throws Exception {
|
public void testExtensionFunctions() throws Exception {
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class BodyResolver {
|
|||||||
descriptor, localContext != null ? localContext.inferenceSession : null
|
descriptor, localContext != null ? localContext.inferenceSession : null
|
||||||
),
|
),
|
||||||
scope -> new LexicalScopeImpl(
|
scope -> new LexicalScopeImpl(
|
||||||
scope, descriptor, scope.isOwnerDescriptorAccessibleByLabel(), scope.getImplicitReceiver(),
|
scope, descriptor, scope.isOwnerDescriptorAccessibleByLabel(), scope.getImplicitReceivers(),
|
||||||
LexicalScopeKind.CONSTRUCTOR_HEADER
|
LexicalScopeKind.CONSTRUCTOR_HEADER
|
||||||
),
|
),
|
||||||
localContext
|
localContext
|
||||||
@@ -439,7 +439,7 @@ public class BodyResolver {
|
|||||||
) {
|
) {
|
||||||
// Initializing a scope will report errors if any.
|
// Initializing a scope will report errors if any.
|
||||||
new LexicalScopeImpl(
|
new LexicalScopeImpl(
|
||||||
scopeForConstructorResolution, descriptor, true, null, LexicalScopeKind.CLASS_HEADER,
|
scopeForConstructorResolution, descriptor, true, Collections.emptyList(), LexicalScopeKind.CLASS_HEADER,
|
||||||
new TraceBasedLocalRedeclarationChecker(trace, overloadChecker),
|
new TraceBasedLocalRedeclarationChecker(trace, overloadChecker),
|
||||||
new Function1<LexicalScopeImpl.InitializeHandler, Unit>() {
|
new Function1<LexicalScopeImpl.InitializeHandler, Unit>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -780,7 +780,7 @@ public class BodyResolver {
|
|||||||
LexicalScope originalScope,
|
LexicalScope originalScope,
|
||||||
ConstructorDescriptor unsubstitutedPrimaryConstructor
|
ConstructorDescriptor unsubstitutedPrimaryConstructor
|
||||||
) {
|
) {
|
||||||
return new LexicalScopeImpl(originalScope, unsubstitutedPrimaryConstructor, false, null,
|
return new LexicalScopeImpl(originalScope, unsubstitutedPrimaryConstructor, false, Collections.emptyList(),
|
||||||
LexicalScopeKind.DEFAULT_VALUE, LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
LexicalScopeKind.DEFAULT_VALUE, LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
||||||
handler -> {
|
handler -> {
|
||||||
for (ValueParameterDescriptor valueParameter : unsubstitutedPrimaryConstructor.getValueParameters()) {
|
for (ValueParameterDescriptor valueParameter : unsubstitutedPrimaryConstructor.getValueParameters()) {
|
||||||
@@ -863,7 +863,12 @@ public class BodyResolver {
|
|||||||
LexicalScope accessorDeclaringScope = c.getDeclaringScope(accessor);
|
LexicalScope accessorDeclaringScope = c.getDeclaringScope(accessor);
|
||||||
assert accessorDeclaringScope != null : "Scope for accessor " + accessor.getText() + " should exists";
|
assert accessorDeclaringScope != null : "Scope for accessor " + accessor.getText() + " should exists";
|
||||||
LexicalScope headerScope = ScopeUtils.makeScopeForPropertyHeader(accessorDeclaringScope, descriptor);
|
LexicalScope headerScope = ScopeUtils.makeScopeForPropertyHeader(accessorDeclaringScope, descriptor);
|
||||||
return new LexicalScopeImpl(headerScope, descriptor, true, descriptor.getExtensionReceiverParameter(),
|
List<ReceiverParameterDescriptor> implicitReceivers = new ArrayList<>();
|
||||||
|
ReceiverParameterDescriptor extensionReceiverParameter = descriptor.getExtensionReceiverParameter();
|
||||||
|
if (extensionReceiverParameter != null) {
|
||||||
|
implicitReceivers.add(extensionReceiverParameter);
|
||||||
|
}
|
||||||
|
return new LexicalScopeImpl(headerScope, descriptor, true, implicitReceivers,
|
||||||
LexicalScopeKind.PROPERTY_ACCESSOR_BODY);
|
LexicalScopeKind.PROPERTY_ACCESSOR_BODY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1023,7 +1028,7 @@ public class BodyResolver {
|
|||||||
KtProperty property = (KtProperty) function.getParent();
|
KtProperty property = (KtProperty) function.getParent();
|
||||||
SourceElement propertySourceElement = KotlinSourceElementKt.toSourceElement(property);
|
SourceElement propertySourceElement = KotlinSourceElementKt.toSourceElement(property);
|
||||||
SyntheticFieldDescriptor fieldDescriptor = new SyntheticFieldDescriptor(accessorDescriptor, propertySourceElement);
|
SyntheticFieldDescriptor fieldDescriptor = new SyntheticFieldDescriptor(accessorDescriptor, propertySourceElement);
|
||||||
innerScope = new LexicalScopeImpl(innerScope, functionDescriptor, true, null,
|
innerScope = new LexicalScopeImpl(innerScope, functionDescriptor, true, Collections.emptyList(),
|
||||||
LexicalScopeKind.PROPERTY_ACCESSOR_BODY,
|
LexicalScopeKind.PROPERTY_ACCESSOR_BODY,
|
||||||
LocalRedeclarationChecker.DO_NOTHING.INSTANCE, handler -> {
|
LocalRedeclarationChecker.DO_NOTHING.INSTANCE, handler -> {
|
||||||
handler.addVariableDescriptor(fieldDescriptor);
|
handler.addVariableDescriptor(fieldDescriptor);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.resolve.scopes.*;
|
|||||||
import org.jetbrains.kotlin.types.*;
|
import org.jetbrains.kotlin.types.*;
|
||||||
import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt;
|
import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class FunctionDescriptorUtil {
|
public class FunctionDescriptorUtil {
|
||||||
@@ -65,8 +66,17 @@ public class FunctionDescriptorUtil {
|
|||||||
@NotNull FunctionDescriptor descriptor,
|
@NotNull FunctionDescriptor descriptor,
|
||||||
@NotNull LocalRedeclarationChecker redeclarationChecker
|
@NotNull LocalRedeclarationChecker redeclarationChecker
|
||||||
) {
|
) {
|
||||||
|
List<ReceiverParameterDescriptor> implicitReceivers = new ArrayList<>();
|
||||||
|
ReceiverParameterDescriptor extensionReceiverParameter = descriptor.getExtensionReceiverParameter();
|
||||||
|
if (descriptor.getExtensionReceiverParameter() != null) {
|
||||||
|
implicitReceivers.add(extensionReceiverParameter);
|
||||||
|
}
|
||||||
|
List<ReceiverParameterDescriptor> contextReceiverParameters = descriptor.getContextReceiverParameters();
|
||||||
|
if (!contextReceiverParameters.isEmpty()) {
|
||||||
|
implicitReceivers.addAll(contextReceiverParameters);
|
||||||
|
}
|
||||||
return new LexicalScopeImpl(
|
return new LexicalScopeImpl(
|
||||||
outerScope, descriptor, true, descriptor.getExtensionReceiverParameter(),
|
outerScope, descriptor, true, implicitReceivers,
|
||||||
LexicalScopeKind.FUNCTION_INNER_SCOPE, redeclarationChecker,
|
LexicalScopeKind.FUNCTION_INNER_SCOPE, redeclarationChecker,
|
||||||
handler -> {
|
handler -> {
|
||||||
for (TypeParameterDescriptor typeParameter : descriptor.getTypeParameters()) {
|
for (TypeParameterDescriptor typeParameter : descriptor.getTypeParameters()) {
|
||||||
|
|||||||
+2
-1
@@ -49,7 +49,8 @@ object DslScopeViolationCallChecker : CallChecker {
|
|||||||
) {
|
) {
|
||||||
val receiversUntilOneFromTheCall =
|
val receiversUntilOneFromTheCall =
|
||||||
context.scope.parentsWithSelf
|
context.scope.parentsWithSelf
|
||||||
.mapNotNull { (it as? LexicalScope)?.implicitReceiver?.value }
|
.flatMap { (it as? LexicalScope)?.implicitReceivers ?: emptyList() }
|
||||||
|
.map { it.value }
|
||||||
.takeWhile { it != callImplicitReceiver }.toList()
|
.takeWhile { it != callImplicitReceiver }.toList()
|
||||||
|
|
||||||
if (receiversUntilOneFromTheCall.isEmpty()) return
|
if (receiversUntilOneFromTheCall.isEmpty()) return
|
||||||
|
|||||||
+2
-4
@@ -366,10 +366,8 @@ class NewResolutionOldInference(
|
|||||||
) : ImplicitScopeTower {
|
) : ImplicitScopeTower {
|
||||||
private val cache = HashMap<ReceiverValue, ReceiverValueWithSmartCastInfo>()
|
private val cache = HashMap<ReceiverValue, ReceiverValueWithSmartCastInfo>()
|
||||||
|
|
||||||
override fun getImplicitReceiver(scope: LexicalScope): ReceiverValueWithSmartCastInfo? =
|
override fun getImplicitReceivers(scope: LexicalScope): List<ReceiverValueWithSmartCastInfo> =
|
||||||
scope.implicitReceiver?.value?.let {
|
scope.implicitReceivers.map { cache.getOrPut(it.value) { resolutionContext.transformToReceiverWithSmartCastInfo(it.value) } }
|
||||||
cache.getOrPut(it) { resolutionContext.transformToReceiverWithSmartCastInfo(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getNameForGivenImportAlias(name: Name): Name? =
|
override fun getNameForGivenImportAlias(name: Name): Name? =
|
||||||
(resolutionContext.call.callElement.containingFile as? KtFile)?.getNameForGivenImportAlias(name)
|
(resolutionContext.call.callElement.containingFile as? KtFile)?.getNameForGivenImportAlias(name)
|
||||||
|
|||||||
@@ -400,13 +400,8 @@ class PSICallResolver(
|
|||||||
override val implicitsResolutionFilter: ImplicitsExtensionsResolutionFilter get() = this@PSICallResolver.implicitsResolutionFilter
|
override val implicitsResolutionFilter: ImplicitsExtensionsResolutionFilter get() = this@PSICallResolver.implicitsResolutionFilter
|
||||||
private val cache = HashMap<ReceiverParameterDescriptor, ReceiverValueWithSmartCastInfo>()
|
private val cache = HashMap<ReceiverParameterDescriptor, ReceiverValueWithSmartCastInfo>()
|
||||||
|
|
||||||
override fun getImplicitReceiver(scope: LexicalScope): ReceiverValueWithSmartCastInfo? {
|
override fun getImplicitReceivers(scope: LexicalScope): List<ReceiverValueWithSmartCastInfo> =
|
||||||
val implicitReceiver = scope.implicitReceiver ?: return null
|
scope.implicitReceivers.map { cache.getOrPut(it) { context.transformToReceiverWithSmartCastInfo(it.value) } }
|
||||||
|
|
||||||
return cache.getOrPut(implicitReceiver) {
|
|
||||||
context.transformToReceiverWithSmartCastInfo(implicitReceiver.value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getNameForGivenImportAlias(name: Name): Name? =
|
override fun getNameForGivenImportAlias(name: Name): Name? =
|
||||||
(context.call.callElement.containingFile as? KtFile)?.getNameForGivenImportAlias(name)
|
(context.call.callElement.containingFile as? KtFile)?.getNameForGivenImportAlias(name)
|
||||||
|
|||||||
+4
-4
@@ -35,7 +35,7 @@ class ClassResolutionScopesSupport(
|
|||||||
private val getOuterScope: () -> LexicalScope
|
private val getOuterScope: () -> LexicalScope
|
||||||
) {
|
) {
|
||||||
private fun scopeWithGenerics(parent: LexicalScope): LexicalScopeImpl {
|
private fun scopeWithGenerics(parent: LexicalScope): LexicalScopeImpl {
|
||||||
return LexicalScopeImpl(parent, classDescriptor, false, null, LexicalScopeKind.CLASS_HEADER) {
|
return LexicalScopeImpl(parent, classDescriptor, false, emptyList(), LexicalScopeKind.CLASS_HEADER) {
|
||||||
classDescriptor.declaredTypeParameters.forEach { addClassifierDescriptor(it) }
|
classDescriptor.declaredTypeParameters.forEach { addClassifierDescriptor(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ class ClassResolutionScopesSupport(
|
|||||||
scopeWithGenerics,
|
scopeWithGenerics,
|
||||||
classDescriptor,
|
classDescriptor,
|
||||||
true,
|
true,
|
||||||
classDescriptor.thisAsReceiverParameter,
|
listOf(classDescriptor.thisAsReceiverParameter),
|
||||||
LexicalScopeKind.CLASS_MEMBER_SCOPE
|
LexicalScopeKind.CLASS_MEMBER_SCOPE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ class ClassResolutionScopesSupport(
|
|||||||
val lexicalChainedScope = LexicalChainedScope.create(
|
val lexicalChainedScope = LexicalChainedScope.create(
|
||||||
parentForNewScope, ownerDescriptor,
|
parentForNewScope, ownerDescriptor,
|
||||||
isOwnerDescriptorAccessibleByLabel = false,
|
isOwnerDescriptorAccessibleByLabel = false,
|
||||||
implicitReceiver = companionObjectDescriptor?.thisAsReceiverParameter,
|
implicitReceivers = listOfNotNull(companionObjectDescriptor?.thisAsReceiverParameter),
|
||||||
kind = LexicalScopeKind.CLASS_INHERITANCE,
|
kind = LexicalScopeKind.CLASS_INHERITANCE,
|
||||||
classDescriptor.staticScope,
|
classDescriptor.staticScope,
|
||||||
classDescriptor.unsubstitutedInnerClassesScope,
|
classDescriptor.unsubstitutedInnerClassesScope,
|
||||||
@@ -146,7 +146,7 @@ fun scopeForInitializerResolution(
|
|||||||
classDescriptor.scopeForMemberDeclarationResolution,
|
classDescriptor.scopeForMemberDeclarationResolution,
|
||||||
parentDescriptor,
|
parentDescriptor,
|
||||||
false,
|
false,
|
||||||
null,
|
emptyList(),
|
||||||
LexicalScopeKind.CLASS_INITIALIZER
|
LexicalScopeKind.CLASS_INITIALIZER
|
||||||
) {
|
) {
|
||||||
if (primaryConstructorParameters.isNotEmpty()) {
|
if (primaryConstructorParameters.isNotEmpty()) {
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ class ValueParameterResolver(
|
|||||||
inferenceSession: InferenceSession?
|
inferenceSession: InferenceSession?
|
||||||
) {
|
) {
|
||||||
val scopeForDefaultValue =
|
val scopeForDefaultValue =
|
||||||
LexicalScopeImpl(declaringScope, declaringScope.ownerDescriptor, false, null, LexicalScopeKind.DEFAULT_VALUE)
|
LexicalScopeImpl(declaringScope, declaringScope.ownerDescriptor, false, listOf(), LexicalScopeKind.DEFAULT_VALUE)
|
||||||
|
|
||||||
val contextForDefaultValue = ExpressionTypingContext.newContext(
|
val contextForDefaultValue = ExpressionTypingContext.newContext(
|
||||||
trace, scopeForDefaultValue, dataFlowInfo, TypeUtils.NO_EXPECTED_TYPE,
|
trace, scopeForDefaultValue, dataFlowInfo, TypeUtils.NO_EXPECTED_TYPE,
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.types.TypeApproximator
|
|||||||
interface ImplicitScopeTower {
|
interface ImplicitScopeTower {
|
||||||
val lexicalScope: LexicalScope
|
val lexicalScope: LexicalScope
|
||||||
|
|
||||||
fun getImplicitReceiver(scope: LexicalScope): ReceiverValueWithSmartCastInfo?
|
fun getImplicitReceivers(scope: LexicalScope): List<ReceiverValueWithSmartCastInfo>
|
||||||
|
|
||||||
fun getNameForGivenImportAlias(name: Name): Name?
|
fun getNameForGivenImportAlias(name: Name): Name?
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class TowerResolver {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
getImplicitReceiver(scope)?.let {
|
getImplicitReceivers(scope).forEach {
|
||||||
addLevel(
|
addLevel(
|
||||||
MemberScopeTowerLevel(this@createNonLocalLevels, it),
|
MemberScopeTowerLevel(this@createNonLocalLevels, it),
|
||||||
it.mayFitForName(name)
|
it.mayFitForName(name)
|
||||||
@@ -197,9 +197,9 @@ class TowerResolver {
|
|||||||
.process(scope.mayFitForName(name))?.let { return it }
|
.process(scope.mayFitForName(name))?.let { return it }
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitScopeTower.getImplicitReceiver(scope)
|
implicitScopeTower.getImplicitReceivers(scope).forEach { rv ->
|
||||||
?.let { processImplicitReceiver(it, resolveExtensionsForImplicitReceiver) }
|
processImplicitReceiver(rv, resolveExtensionsForImplicitReceiver)?.let { return it }
|
||||||
?.let { return it }
|
}
|
||||||
} else {
|
} else {
|
||||||
TowerData.TowerLevel(ImportingScopeBasedTowerLevel(implicitScopeTower, scope as ImportingScope))
|
TowerData.TowerLevel(ImportingScopeBasedTowerLevel(implicitScopeTower, scope as ImportingScope))
|
||||||
.process(scope.mayFitForName(name))?.let { return it }
|
.process(scope.mayFitForName(name))?.let { return it }
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class LexicalChainedScope private constructor(
|
|||||||
parent: LexicalScope,
|
parent: LexicalScope,
|
||||||
override val ownerDescriptor: DeclarationDescriptor,
|
override val ownerDescriptor: DeclarationDescriptor,
|
||||||
override val isOwnerDescriptorAccessibleByLabel: Boolean,
|
override val isOwnerDescriptorAccessibleByLabel: Boolean,
|
||||||
override val implicitReceiver: ReceiverParameterDescriptor?,
|
override val implicitReceivers: List<ReceiverParameterDescriptor>,
|
||||||
override val kind: LexicalScopeKind,
|
override val kind: LexicalScopeKind,
|
||||||
// NB. Here can be very special subtypes of MemberScope (e.g., DeprecatedMemberScope).
|
// NB. Here can be very special subtypes of MemberScope (e.g., DeprecatedMemberScope).
|
||||||
// Please, do not leak them outside of LexicalChainedScope, because other parts of compiler are not ready to work with them
|
// Please, do not leak them outside of LexicalChainedScope, because other parts of compiler are not ready to work with them
|
||||||
@@ -74,8 +74,14 @@ class LexicalChainedScope private constructor(
|
|||||||
|
|
||||||
override fun printStructure(p: Printer) {
|
override fun printStructure(p: Printer) {
|
||||||
p.println(
|
p.println(
|
||||||
this::class.java.simpleName, ": ", kind, "; for descriptor: ", ownerDescriptor.name,
|
this::class.java.simpleName,
|
||||||
" with implicitReceiver: ", implicitReceiver?.value ?: "NONE", " {"
|
": ",
|
||||||
|
kind,
|
||||||
|
"; for descriptor: ",
|
||||||
|
ownerDescriptor.name,
|
||||||
|
" with implicitReceiver: ",
|
||||||
|
if (implicitReceivers.isEmpty()) "NONE" else implicitReceivers.joinToString { it.value.toString() },
|
||||||
|
" {"
|
||||||
)
|
)
|
||||||
p.pushIndent()
|
p.pushIndent()
|
||||||
|
|
||||||
@@ -105,13 +111,13 @@ class LexicalChainedScope private constructor(
|
|||||||
parent: LexicalScope,
|
parent: LexicalScope,
|
||||||
ownerDescriptor: DeclarationDescriptor,
|
ownerDescriptor: DeclarationDescriptor,
|
||||||
isOwnerDescriptorAccessibleByLabel: Boolean,
|
isOwnerDescriptorAccessibleByLabel: Boolean,
|
||||||
implicitReceiver: ReceiverParameterDescriptor?,
|
implicitReceivers: List<ReceiverParameterDescriptor>,
|
||||||
kind: LexicalScopeKind,
|
kind: LexicalScopeKind,
|
||||||
vararg memberScopes: MemberScope?,
|
vararg memberScopes: MemberScope?,
|
||||||
isStaticScope: Boolean = false
|
isStaticScope: Boolean = false
|
||||||
): LexicalScope =
|
): LexicalScope =
|
||||||
LexicalChainedScope(
|
LexicalChainedScope(
|
||||||
parent, ownerDescriptor, isOwnerDescriptorAccessibleByLabel, implicitReceiver, kind,
|
parent, ownerDescriptor, isOwnerDescriptorAccessibleByLabel, implicitReceivers, kind,
|
||||||
listOfNonEmptyScopes(*memberScopes).toTypedArray(),
|
listOfNonEmptyScopes(*memberScopes).toTypedArray(),
|
||||||
isStaticScope
|
isStaticScope
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class LexicalScopeImpl @JvmOverloads constructor(
|
|||||||
parent: HierarchicalScope,
|
parent: HierarchicalScope,
|
||||||
override val ownerDescriptor: DeclarationDescriptor,
|
override val ownerDescriptor: DeclarationDescriptor,
|
||||||
override val isOwnerDescriptorAccessibleByLabel: Boolean,
|
override val isOwnerDescriptorAccessibleByLabel: Boolean,
|
||||||
override val implicitReceiver: ReceiverParameterDescriptor?,
|
override val implicitReceivers: List<ReceiverParameterDescriptor>,
|
||||||
override val kind: LexicalScopeKind,
|
override val kind: LexicalScopeKind,
|
||||||
redeclarationChecker: LocalRedeclarationChecker = LocalRedeclarationChecker.DO_NOTHING,
|
redeclarationChecker: LocalRedeclarationChecker = LocalRedeclarationChecker.DO_NOTHING,
|
||||||
initialize: LexicalScopeImpl.InitializeHandler.() -> Unit = {}
|
initialize: LexicalScopeImpl.InitializeHandler.() -> Unit = {}
|
||||||
@@ -37,8 +37,14 @@ class LexicalScopeImpl @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun printStructure(p: Printer) {
|
override fun printStructure(p: Printer) {
|
||||||
p.println(
|
p.println(
|
||||||
this::class.java.simpleName, ": ", kind, "; for descriptor: ", ownerDescriptor.name,
|
this::class.java.simpleName,
|
||||||
" with implicitReceiver: ", implicitReceiver?.value ?: "NONE", " {"
|
": ",
|
||||||
|
kind,
|
||||||
|
"; for descriptor: ",
|
||||||
|
ownerDescriptor.name,
|
||||||
|
" with implicitReceiver: ",
|
||||||
|
if (implicitReceivers.isEmpty()) "NONE" else implicitReceivers.joinToString { it.value.toString() },
|
||||||
|
" {"
|
||||||
)
|
)
|
||||||
p.pushIndent()
|
p.pushIndent()
|
||||||
|
|
||||||
|
|||||||
+10
-4
@@ -30,8 +30,8 @@ class LexicalWritableScope(
|
|||||||
override val kind: LexicalScopeKind
|
override val kind: LexicalScopeKind
|
||||||
) : LexicalScopeStorage(parent, redeclarationChecker) {
|
) : LexicalScopeStorage(parent, redeclarationChecker) {
|
||||||
|
|
||||||
override val implicitReceiver: ReceiverParameterDescriptor?
|
override val implicitReceivers: List<ReceiverParameterDescriptor>
|
||||||
get() = null
|
get() = emptyList()
|
||||||
|
|
||||||
private var canWrite: Boolean = true
|
private var canWrite: Boolean = true
|
||||||
private var lastSnapshot: Snapshot? = null
|
private var lastSnapshot: Snapshot? = null
|
||||||
@@ -105,8 +105,14 @@ class LexicalWritableScope(
|
|||||||
|
|
||||||
override fun printStructure(p: Printer) {
|
override fun printStructure(p: Printer) {
|
||||||
p.println(
|
p.println(
|
||||||
this::class.java.simpleName, ": ", kind, "; for descriptor: ", ownerDescriptor.name,
|
this::class.java.simpleName,
|
||||||
" with implicitReceiver: ", implicitReceiver?.value ?: "NONE", " {"
|
": ",
|
||||||
|
kind,
|
||||||
|
"; for descriptor: ",
|
||||||
|
ownerDescriptor.name,
|
||||||
|
" with implicitReceivers: ",
|
||||||
|
if (implicitReceivers.isEmpty()) "NONE" else implicitReceivers.joinToString { it.value.toString() },
|
||||||
|
" {"
|
||||||
)
|
)
|
||||||
p.pushIndent()
|
p.pushIndent()
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,15 @@ import kotlin.Unit;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor;
|
import org.jetbrains.kotlin.descriptors.PropertyDescriptor;
|
||||||
|
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor;
|
||||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
|
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
|
||||||
import org.jetbrains.kotlin.descriptors.VariableDescriptorWithAccessors;
|
import org.jetbrains.kotlin.descriptors.VariableDescriptorWithAccessors;
|
||||||
import org.jetbrains.kotlin.utils.Printer;
|
import org.jetbrains.kotlin.utils.Printer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public final class ScopeUtils {
|
public final class ScopeUtils {
|
||||||
private ScopeUtils() {}
|
private ScopeUtils() {}
|
||||||
|
|
||||||
@@ -31,7 +36,7 @@ public final class ScopeUtils {
|
|||||||
@NotNull LexicalScope parent,
|
@NotNull LexicalScope parent,
|
||||||
@NotNull PropertyDescriptor propertyDescriptor
|
@NotNull PropertyDescriptor propertyDescriptor
|
||||||
) {
|
) {
|
||||||
return new LexicalScopeImpl(parent, propertyDescriptor, false, null, LexicalScopeKind.PROPERTY_HEADER,
|
return new LexicalScopeImpl(parent, propertyDescriptor, false, Collections.emptyList(), LexicalScopeKind.PROPERTY_HEADER,
|
||||||
// redeclaration on type parameters should be reported early, see: DescriptorResolver.resolvePropertyDescriptor()
|
// redeclaration on type parameters should be reported early, see: DescriptorResolver.resolvePropertyDescriptor()
|
||||||
LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
||||||
handler -> {
|
handler -> {
|
||||||
@@ -47,7 +52,7 @@ public final class ScopeUtils {
|
|||||||
@NotNull LexicalScope propertyHeader,
|
@NotNull LexicalScope propertyHeader,
|
||||||
@NotNull PropertyDescriptor propertyDescriptor
|
@NotNull PropertyDescriptor propertyDescriptor
|
||||||
) {
|
) {
|
||||||
return new LexicalScopeImpl(propertyHeader, propertyDescriptor, false, null, LexicalScopeKind.PROPERTY_INITIALIZER_OR_DELEGATE);
|
return new LexicalScopeImpl(propertyHeader, propertyDescriptor, false, Collections.emptyList(), LexicalScopeKind.PROPERTY_INITIALIZER_OR_DELEGATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -55,8 +60,13 @@ public final class ScopeUtils {
|
|||||||
@NotNull LexicalScope parent,
|
@NotNull LexicalScope parent,
|
||||||
@NotNull VariableDescriptorWithAccessors variableDescriptor
|
@NotNull VariableDescriptorWithAccessors variableDescriptor
|
||||||
) {
|
) {
|
||||||
|
List<ReceiverParameterDescriptor> implicitReceivers = new ArrayList<>();
|
||||||
|
ReceiverParameterDescriptor extensionReceiverParameter = variableDescriptor.getExtensionReceiverParameter();
|
||||||
|
if (extensionReceiverParameter != null) {
|
||||||
|
implicitReceivers.add(extensionReceiverParameter);
|
||||||
|
}
|
||||||
// todo: very strange scope!
|
// todo: very strange scope!
|
||||||
return new LexicalScopeImpl(parent, variableDescriptor, true, variableDescriptor.getExtensionReceiverParameter(),
|
return new LexicalScopeImpl(parent, variableDescriptor, true, implicitReceivers,
|
||||||
LexicalScopeKind.PROPERTY_DELEGATE_METHOD
|
LexicalScopeKind.PROPERTY_DELEGATE_METHOD
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ interface LexicalScope : HierarchicalScope {
|
|||||||
val ownerDescriptor: DeclarationDescriptor
|
val ownerDescriptor: DeclarationDescriptor
|
||||||
val isOwnerDescriptorAccessibleByLabel: Boolean
|
val isOwnerDescriptorAccessibleByLabel: Boolean
|
||||||
|
|
||||||
val implicitReceiver: ReceiverParameterDescriptor?
|
val implicitReceivers: List<ReceiverParameterDescriptor>
|
||||||
|
|
||||||
val kind: LexicalScopeKind
|
val kind: LexicalScopeKind
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ interface LexicalScope : HierarchicalScope {
|
|||||||
override val isOwnerDescriptorAccessibleByLabel: Boolean
|
override val isOwnerDescriptorAccessibleByLabel: Boolean
|
||||||
get() = false
|
get() = false
|
||||||
|
|
||||||
override val implicitReceiver: ReceiverParameterDescriptor?
|
override val implicitReceivers: List<ReceiverParameterDescriptor>
|
||||||
get() = null
|
get() = emptyList()
|
||||||
|
|
||||||
override val kind: LexicalScopeKind
|
override val kind: LexicalScopeKind
|
||||||
get() = LexicalScopeKind.EMPTY
|
get() = LexicalScopeKind.EMPTY
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ val HierarchicalScope.parents: Sequence<HierarchicalScope>
|
|||||||
* Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
|
* Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
|
||||||
*/
|
*/
|
||||||
fun LexicalScope.getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> = collectFromMeAndParent {
|
fun LexicalScope.getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> = collectFromMeAndParent {
|
||||||
(it as? LexicalScope)?.implicitReceiver
|
(it as? LexicalScope)?.implicitReceivers
|
||||||
}
|
}.flatten()
|
||||||
|
|
||||||
fun LexicalScope.getDeclarationsByLabel(labelName: Name): Collection<DeclarationDescriptor> = collectAllFromMeAndParent {
|
fun LexicalScope.getDeclarationsByLabel(labelName: Name): Collection<DeclarationDescriptor> = collectAllFromMeAndParent {
|
||||||
if (it is LexicalScope && it.isOwnerDescriptorAccessibleByLabel && it.ownerDescriptor.name == labelName) {
|
if (it is LexicalScope && it.isOwnerDescriptorAccessibleByLabel && it.ownerDescriptor.name == labelName) {
|
||||||
@@ -261,7 +261,7 @@ fun LexicalScope.replaceImportingScopes(importingScopeChain: ImportingScope?): L
|
|||||||
fun LexicalScope.createScopeForDestructuring(newReceiver: ReceiverParameterDescriptor?): LexicalScope {
|
fun LexicalScope.createScopeForDestructuring(newReceiver: ReceiverParameterDescriptor?): LexicalScope {
|
||||||
return LexicalScopeImpl(
|
return LexicalScopeImpl(
|
||||||
parent, ownerDescriptor, isOwnerDescriptorAccessibleByLabel,
|
parent, ownerDescriptor, isOwnerDescriptorAccessibleByLabel,
|
||||||
newReceiver,
|
listOfNotNull(newReceiver),
|
||||||
LexicalScopeKind.FUNCTION_HEADER_FOR_DESTRUCTURING
|
LexicalScopeKind.FUNCTION_HEADER_FOR_DESTRUCTURING
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -324,7 +324,7 @@ class ErrorLexicalScope : LexicalScope {
|
|||||||
|
|
||||||
override val ownerDescriptor: DeclarationDescriptor = ErrorUtils.createErrorClass("<ERROR CLASS FOR ERROR SCOPE>")
|
override val ownerDescriptor: DeclarationDescriptor = ErrorUtils.createErrorClass("<ERROR CLASS FOR ERROR SCOPE>")
|
||||||
override val isOwnerDescriptorAccessibleByLabel: Boolean = false
|
override val isOwnerDescriptorAccessibleByLabel: Boolean = false
|
||||||
override val implicitReceiver: ReceiverParameterDescriptor? = null
|
override val implicitReceivers: List<ReceiverParameterDescriptor> = emptyList()
|
||||||
override val kind: LexicalScopeKind = LexicalScopeKind.THROWING
|
override val kind: LexicalScopeKind = LexicalScopeKind.THROWING
|
||||||
|
|
||||||
override fun getContributedClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? = null
|
override fun getContributedClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? = null
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
class A {
|
||||||
|
fun h1() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
class B {
|
||||||
|
fun h2() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun B.foo() {
|
||||||
|
<!UNRESOLVED_REFERENCE!>h1<!>()
|
||||||
|
h2()
|
||||||
|
}
|
||||||
|
|
||||||
|
context(A)
|
||||||
|
fun B.bar() {
|
||||||
|
<!UNRESOLVED_REFERENCE!>h1<!>()
|
||||||
|
h2()
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
class A {
|
||||||
|
fun h1() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
class B {
|
||||||
|
fun h2() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun B.foo() {
|
||||||
|
<!UNRESOLVED_REFERENCE!>h1<!>()
|
||||||
|
h2()
|
||||||
|
}
|
||||||
|
|
||||||
|
context(A)
|
||||||
|
fun B.bar() {
|
||||||
|
h1()
|
||||||
|
h2()
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun B.bar(): kotlin.Unit
|
||||||
|
public fun B.foo(): kotlin.Unit
|
||||||
|
|
||||||
|
public final class A {
|
||||||
|
public constructor A()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public final fun h1(): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class B {
|
||||||
|
public constructor B()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public final fun h2(): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
Generated
+6
@@ -10477,6 +10477,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/extensions/classObject.kt");
|
runTest("compiler/testData/diagnostics/tests/extensions/classObject.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("contextReceiver.kt")
|
||||||
|
public void testContextReceiver() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/extensions/contextReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ExtensionFunctions.kt")
|
@TestMetadata("ExtensionFunctions.kt")
|
||||||
public void testExtensionFunctions() throws Exception {
|
public void testExtensionFunctions() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -148,7 +148,7 @@ public class ExpectedResolveDataUtil {
|
|||||||
emptyModule.initialize(PackageFragmentProvider.Empty.INSTANCE);
|
emptyModule.initialize(PackageFragmentProvider.Empty.INSTANCE);
|
||||||
|
|
||||||
LexicalScopeImpl lexicalScope = new LexicalScopeImpl(ImportingScope.Empty.INSTANCE, classDescriptor, false,
|
LexicalScopeImpl lexicalScope = new LexicalScopeImpl(ImportingScope.Empty.INSTANCE, classDescriptor, false,
|
||||||
classDescriptor.getThisAsReceiverParameter(),
|
Collections.singletonList(classDescriptor.getThisAsReceiverParameter()),
|
||||||
LexicalScopeKind.SYNTHETIC);
|
LexicalScopeKind.SYNTHETIC);
|
||||||
|
|
||||||
LanguageVersionSettings languageVersionSettings = CommonConfigurationKeysKt.getLanguageVersionSettings(environment.getConfiguration());
|
LanguageVersionSettings languageVersionSettings = CommonConfigurationKeysKt.getLanguageVersionSettings(environment.getConfiguration());
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class DefaultModalityModifiersTest extends KotlinTestWithEnvironment {
|
|||||||
DeclarationDescriptor classDescriptor =
|
DeclarationDescriptor classDescriptor =
|
||||||
bindingContext.getBindingContext().get(BindingContext.DECLARATION_TO_DESCRIPTOR, aClass);
|
bindingContext.getBindingContext().get(BindingContext.DECLARATION_TO_DESCRIPTOR, aClass);
|
||||||
return new LexicalScopeImpl(
|
return new LexicalScopeImpl(
|
||||||
ScopeUtilsKt.memberScopeAsImportingScope(libraryScope), root, false, null,
|
ScopeUtilsKt.memberScopeAsImportingScope(libraryScope), root, false, Collections.emptyList(),
|
||||||
LexicalScopeKind.SYNTHETIC, LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
LexicalScopeKind.SYNTHETIC, LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
||||||
handler -> {
|
handler -> {
|
||||||
handler.addClassifierDescriptor((ClassifierDescriptor) classDescriptor);
|
handler.addClassifierDescriptor((ClassifierDescriptor) classDescriptor);
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ public class KotlinTypeCheckerTest extends KotlinTestWithEnvironment {
|
|||||||
);
|
);
|
||||||
|
|
||||||
LexicalScope scope = new LexicalScopeImpl(scopeWithImports, scopeWithImports.getOwnerDescriptor(), false,
|
LexicalScope scope = new LexicalScopeImpl(scopeWithImports, scopeWithImports.getOwnerDescriptor(), false,
|
||||||
receiverParameterDescriptor, LexicalScopeKind.SYNTHETIC);
|
Collections.singletonList(receiverParameterDescriptor), LexicalScopeKind.SYNTHETIC);
|
||||||
assertType(scope, expression, expectedType);
|
assertType(scope, expression, expectedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import org.jetbrains.kotlin.tests.di.InjectionKt;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@ public class TypeSubstitutorTest extends KotlinTestWithEnvironment {
|
|||||||
LocalRedeclarationChecker redeclarationChecker =
|
LocalRedeclarationChecker redeclarationChecker =
|
||||||
new ThrowingLocalRedeclarationChecker(new OverloadChecker(TypeSpecificityComparator.NONE.INSTANCE));
|
new ThrowingLocalRedeclarationChecker(new OverloadChecker(TypeSpecificityComparator.NONE.INSTANCE));
|
||||||
LexicalScope typeParameters = new LexicalScopeImpl(
|
LexicalScope typeParameters = new LexicalScopeImpl(
|
||||||
topLevelScope, module, false, null, LexicalScopeKind.SYNTHETIC,
|
topLevelScope, module, false, Collections.emptyList(), LexicalScopeKind.SYNTHETIC,
|
||||||
redeclarationChecker,
|
redeclarationChecker,
|
||||||
handler -> {
|
handler -> {
|
||||||
for (TypeParameterDescriptor parameterDescriptor : contextClass.getTypeConstructor().getParameters()) {
|
for (TypeParameterDescriptor parameterDescriptor : contextClass.getTypeConstructor().getParameters()) {
|
||||||
@@ -100,7 +101,7 @@ public class TypeSubstitutorTest extends KotlinTestWithEnvironment {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
return LexicalChainedScope.Companion.create(
|
return LexicalChainedScope.Companion.create(
|
||||||
typeParameters, module, false, null, LexicalScopeKind.SYNTHETIC,
|
typeParameters, module, false, Collections.emptyList(), LexicalScopeKind.SYNTHETIC,
|
||||||
contextClass.getDefaultType().getMemberScope(),
|
contextClass.getDefaultType().getMemberScope(),
|
||||||
module.getBuiltIns().getBuiltInsPackageScope()
|
module.getBuiltIns().getBuiltInsPackageScope()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.test.ConfigurationKind;
|
|||||||
import org.jetbrains.kotlin.test.DummyTraces;
|
import org.jetbrains.kotlin.test.DummyTraces;
|
||||||
import org.jetbrains.kotlin.test.KotlinTestWithEnvironment;
|
import org.jetbrains.kotlin.test.KotlinTestWithEnvironment;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -197,7 +198,7 @@ public class TypeUnifierTest extends KotlinTestWithEnvironment {
|
|||||||
private TypeProjection makeType(String typeStr) {
|
private TypeProjection makeType(String typeStr) {
|
||||||
LexicalScope withX = new LexicalScopeImpl(
|
LexicalScope withX = new LexicalScopeImpl(
|
||||||
builtinsImportingScope, module,
|
builtinsImportingScope, module,
|
||||||
false, null, LexicalScopeKind.SYNTHETIC, LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
false, Collections.emptyList(), LexicalScopeKind.SYNTHETIC, LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
|
||||||
handler -> {
|
handler -> {
|
||||||
handler.addClassifierDescriptor(x);
|
handler.addClassifierDescriptor(x);
|
||||||
handler.addClassifierDescriptor(y);
|
handler.addClassifierDescriptor(y);
|
||||||
|
|||||||
+1
-1
@@ -374,7 +374,7 @@ class LazyScriptDescriptor(
|
|||||||
outerScope,
|
outerScope,
|
||||||
receiverClassDescriptor,
|
receiverClassDescriptor,
|
||||||
true,
|
true,
|
||||||
receiverClassDescriptor.thisAsReceiverParameter,
|
listOf(receiverClassDescriptor.thisAsReceiverParameter),
|
||||||
LexicalScopeKind.CLASS_MEMBER_SCOPE
|
LexicalScopeKind.CLASS_MEMBER_SCOPE
|
||||||
).addImportingScope(
|
).addImportingScope(
|
||||||
AllUnderImportScope.create(receiverClassDescriptor, emptyList())
|
AllUnderImportScope.create(receiverClassDescriptor, emptyList())
|
||||||
|
|||||||
+2
-2
@@ -41,8 +41,8 @@ class ReplImplicitsExtensionsResolutionFilter(
|
|||||||
): Sequence<ScopeWithImplicitsExtensionsResolutionInfo> {
|
): Sequence<ScopeWithImplicitsExtensionsResolutionInfo> {
|
||||||
val processedReceivers = mutableSetOf<String>()
|
val processedReceivers = mutableSetOf<String>()
|
||||||
return scopes.map { scope ->
|
return scopes.map { scope ->
|
||||||
val receiver = (scope as? LexicalScope)?.implicitReceiver?.value
|
val receivers = (scope as? LexicalScope)?.implicitReceivers?.map { it.value }
|
||||||
val keep = receiver?.let {
|
val keep = receivers?.all {
|
||||||
lock.read {
|
lock.read {
|
||||||
when (val descriptorFqName = (it as? ImplicitClassReceiver)?.declarationDescriptor?.fqNameSafe?.asString()) {
|
when (val descriptorFqName = (it as? ImplicitClassReceiver)?.declarationDescriptor?.fqNameSafe?.asString()) {
|
||||||
null -> true
|
null -> true
|
||||||
|
|||||||
Reference in New Issue
Block a user