KT-50728 Enforce receiver type resolve
When stdlib is represented as a source dependency (which seems to be the case in the `kotlin` project), it will be resolved lazily for the IDE. Same thing can happen if someone decides to "extend" the stdlib by declaring their declaration in the `kotlin` package In both of those cases, we need to make sure that receiver type is fully resolved before trying to get a `coneType` from it N.B. To make resolve tests work, I've added a separate folder `withAllowedKotlinPackage` to the `testData`, because in the default test setup it is not allowed to extend the `kotlin` package by user's definitions ^KT-50728 Fixed
This commit is contained in:
+1
-1
@@ -262,7 +262,7 @@ class ScopeTowerLevel(
|
||||
if (scope is FirDefaultStarImportingScope && extensionReceiver != null) {
|
||||
val extensionReceiverType = extensionReceiver.type
|
||||
if (extensionReceiverType is ConeClassLikeType) {
|
||||
val declarationReceiverType = candidate.fir.receiverTypeRef?.coneType
|
||||
val declarationReceiverType = candidate.resolvedReceiverTypeRef?.coneType
|
||||
if (declarationReceiverType is ConeClassLikeType) {
|
||||
if (!AbstractTypeChecker.isSubtypeOf(
|
||||
session.typeContext,
|
||||
|
||||
Reference in New Issue
Block a user