DelegatingDataFlowInfo: default constructor

This commit is contained in:
Mikhail Glukhikh
2016-01-20 14:01:27 +03:00
parent 7870ad2445
commit d5ffa0bbca
2 changed files with 7 additions and 7 deletions
@@ -98,7 +98,5 @@ interface DataFlowInfo {
object DataFlowInfoFactory {
@JvmField
val EMPTY: DataFlowInfo = DelegatingDataFlowInfo(
null, ImmutableMap.of<DataFlowValue, Nullability>(), DelegatingDataFlowInfo.newTypeInfo()
)
val EMPTY: DataFlowInfo = DelegatingDataFlowInfo()
}
@@ -27,11 +27,11 @@ import java.util.*
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability.NOT_NULL
internal class DelegatingDataFlowInfo(
private val parent: DataFlowInfo?,
private val nullabilityInfo: ImmutableMap<DataFlowValue, Nullability>,
internal class DelegatingDataFlowInfo private constructor(
private val parent: DataFlowInfo? = null,
private val nullabilityInfo: ImmutableMap<DataFlowValue, Nullability> = ImmutableMap.of(),
// 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
* so parent type info should not be in use
@@ -39,6 +39,8 @@ internal class DelegatingDataFlowInfo(
private val valueWithGivenTypeInfo: DataFlowValue? = null
) : DataFlowInfo {
constructor(): this(null)
override val completeNullabilityInfo: Map<DataFlowValue, Nullability>
get() {
val result = Maps.newHashMap<DataFlowValue, Nullability>()