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 { object DataFlowInfoFactory {
@JvmField @JvmField
val EMPTY: DataFlowInfo = DelegatingDataFlowInfo( val EMPTY: DataFlowInfo = DelegatingDataFlowInfo()
null, ImmutableMap.of<DataFlowValue, Nullability>(), DelegatingDataFlowInfo.newTypeInfo()
)
} }
@@ -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>()