diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactoryImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactoryImpl.kt index edcd23c2c87..1cbfe6dda9f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactoryImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactoryImpl.kt @@ -89,11 +89,11 @@ class DataFlowValueFactoryImpl constructor(private val languageVersionSettings: KotlinBuiltIns.isNullableNothing(type) -> DataFlowValue.nullValue(containingDeclarationOrModule.builtIns) // 'null' is the only inhabitant of 'Nothing?' - // In most cases type of `E!!`-expression is strictly not nullable and we could get proper Nullability - // by calling `getImmanentNullability` (as it happens below). - // - // But there are some problem with types built on type parameters, e.g. - // fun foo(x: T) = x!!.hashCode() // there no way in type system to denote that `x!!` is not nullable + // In most cases type of `E!!`-expression is strictly not nullable and we could get proper Nullability + // by calling `getImmanentNullability` (as it happens below). + // + // But there are some problem with types built on type parameters, e.g. + // fun foo(x: T) = x!!.hashCode() // there no way in type system to denote that `x!!` is not nullable ExpressionTypingUtils.isExclExclExpression(KtPsiUtil.deparenthesize(expression)) -> DataFlowValue(IdentifierInfo.Expression(expression), type, Nullability.NOT_NULL) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/IdentifierInfo.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/IdentifierInfo.kt index 54bd50140a0..0e6167c77f3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/IdentifierInfo.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/IdentifierInfo.kt @@ -33,7 +33,6 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue import org.jetbrains.kotlin.resolve.scopes.receivers.TransientReceiver import org.jetbrains.kotlin.types.KotlinType -import org.jetbrains.kotlin.types.KotlinTypeRefinerImpl import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner interface IdentifierInfo { @@ -150,8 +149,10 @@ internal fun getIdForStableIdentifier( is KtQualifiedExpression -> { val receiverExpression = expression.receiverExpression val selectorExpression = expression.selectorExpression - val receiverInfo = getIdForStableIdentifier(receiverExpression, bindingContext, containingDeclarationOrModule, languageVersionSettings) - val selectorInfo = getIdForStableIdentifier(selectorExpression, bindingContext, containingDeclarationOrModule, languageVersionSettings) + val receiverInfo = + getIdForStableIdentifier(receiverExpression, bindingContext, containingDeclarationOrModule, languageVersionSettings) + val selectorInfo = + getIdForStableIdentifier(selectorExpression, bindingContext, containingDeclarationOrModule, languageVersionSettings) qualified( receiverInfo, bindingContext.getType(receiverExpression), @@ -267,7 +268,7 @@ private fun getIdForImplicitReceiver(receiverValue: ReceiverValue?, expression: private fun getIdForThisReceiver(descriptorOfThisReceiver: DeclarationDescriptor?) = when (descriptorOfThisReceiver) { is CallableDescriptor -> { val receiverParameter = descriptorOfThisReceiver.extensionReceiverParameter - ?: error("'This' refers to the callable member without a receiver parameter: $descriptorOfThisReceiver") + ?: error("'This' refers to the callable member without a receiver parameter: $descriptorOfThisReceiver") IdentifierInfo.Receiver(receiverParameter.value) }