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 2582ae3310c..d011ed66c0d 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 @@ -23,8 +23,9 @@ import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils import org.jetbrains.kotlin.types.isError -@Deprecated("Please, avoid to use that implementation explicitly. If you need DataFlowValueFactory, use injection") -class DataFlowValueFactoryImpl : DataFlowValueFactory { +class DataFlowValueFactoryImpl +@Deprecated("Please, avoid to use that implementation explicitly. If you need DataFlowValueFactory, use injection") constructor() : + DataFlowValueFactory { // Receivers override fun createDataFlowValue( @@ -89,11 +90,11 @@ class DataFlowValueFactoryImpl : DataFlowValueFactory { 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)