Minor: reformat
This commit is contained in:
+5
-5
@@ -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 <T : Any?> 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 <T : Any?> 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)
|
||||
|
||||
|
||||
+5
-4
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user