DelegatingDataFlowInfo: default constructor
This commit is contained in:
@@ -98,7 +98,5 @@ interface DataFlowInfo {
|
|||||||
|
|
||||||
object DataFlowInfoFactory {
|
object DataFlowInfoFactory {
|
||||||
@JvmField
|
@JvmField
|
||||||
val EMPTY: DataFlowInfo = DelegatingDataFlowInfo(
|
val EMPTY: DataFlowInfo = DelegatingDataFlowInfo()
|
||||||
null, ImmutableMap.of<DataFlowValue, Nullability>(), DelegatingDataFlowInfo.newTypeInfo()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-4
@@ -27,11 +27,11 @@ import java.util.*
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability.NOT_NULL
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability.NOT_NULL
|
||||||
|
|
||||||
internal class DelegatingDataFlowInfo(
|
internal class DelegatingDataFlowInfo private constructor(
|
||||||
private val parent: DataFlowInfo?,
|
private val parent: DataFlowInfo? = null,
|
||||||
private val nullabilityInfo: ImmutableMap<DataFlowValue, Nullability>,
|
private val nullabilityInfo: ImmutableMap<DataFlowValue, Nullability> = ImmutableMap.of(),
|
||||||
// Also immutable
|
// Also immutable
|
||||||
private val typeInfo: SetMultimap<DataFlowValue, KotlinType>,
|
private val typeInfo: SetMultimap<DataFlowValue, KotlinType> = newTypeInfo(),
|
||||||
/**
|
/**
|
||||||
* Value for which type info was cleared or reassigned at this point
|
* Value for which type info was cleared or reassigned at this point
|
||||||
* so parent type info should not be in use
|
* so parent type info should not be in use
|
||||||
@@ -39,6 +39,8 @@ internal class DelegatingDataFlowInfo(
|
|||||||
private val valueWithGivenTypeInfo: DataFlowValue? = null
|
private val valueWithGivenTypeInfo: DataFlowValue? = null
|
||||||
) : DataFlowInfo {
|
) : DataFlowInfo {
|
||||||
|
|
||||||
|
constructor(): this(null)
|
||||||
|
|
||||||
override val completeNullabilityInfo: Map<DataFlowValue, Nullability>
|
override val completeNullabilityInfo: Map<DataFlowValue, Nullability>
|
||||||
get() {
|
get() {
|
||||||
val result = Maps.newHashMap<DataFlowValue, Nullability>()
|
val result = Maps.newHashMap<DataFlowValue, Nullability>()
|
||||||
|
|||||||
Reference in New Issue
Block a user