K2: Do not add extension receiver's constraint twice for references
The job is already done at CheckExtensionReceiver resolution stage And repeating it might only lead to incorrect errors caused by double-capture of receiver type that leads to contradiction because in previous commit we started assuming different capture instantiations as different types.
This commit is contained in:
committed by
Space Team
parent
2b3f34cc52
commit
9af3e5704d
-8
@@ -70,14 +70,6 @@ internal object CheckCallableReferenceExpectedType : CheckerStage() {
|
||||
) {
|
||||
addSubtypeConstraint(resultingType, expectedType, position)
|
||||
}
|
||||
|
||||
val declarationReceiverType: ConeKotlinType? =
|
||||
fir.receiverParameter?.typeRef?.coneType?.let(candidate.substitutor::substituteOrSelf)
|
||||
|
||||
if (resultingReceiverType != null && declarationReceiverType != null) {
|
||||
val capturedReceiver = context.session.typeContext.captureFromExpression(resultingReceiverType) ?: resultingReceiverType
|
||||
addSubtypeConstraint(capturedReceiver, declarationReceiverType, position)
|
||||
}
|
||||
}
|
||||
|
||||
var isApplicable = true
|
||||
|
||||
Reference in New Issue
Block a user