org.jetbrains.kotlin.resolve.calls.smartcasts
Interface DataFlowInfo


public interface DataFlowInfo

This interface is intended to provide and edit information about value nullabilities and possible types. Data flow info is immutable so functions never change it.


Field Summary
static DataFlowInfo EMPTY
           
 
Method Summary
 DataFlowInfo and(DataFlowInfo other)
          Call this function to add data flow information from other to this and return sum as the result
 DataFlowInfo assign(DataFlowValue a, DataFlowValue b)
          Call this function when b is assigned to a
 DataFlowInfo clearValueInfo(DataFlowValue value)
          Call this function to clear all data flow information about the given data flow value.
 DataFlowInfo disequate(DataFlowValue a, DataFlowValue b)
          Call this function when it's known than a != b
 DataFlowInfo equate(DataFlowValue a, DataFlowValue b)
          Call this function when it's known than a == b
 DataFlowInfo establishSubtyping(DataFlowValue value, KotlinType type)
           
 java.util.Map<DataFlowValue,Nullability> getCompleteNullabilityInfo()
           
 com.google.common.collect.SetMultimap<DataFlowValue,KotlinType> getCompleteTypeInfo()
           
 Nullability getNullability(DataFlowValue key)
          Returns collected nullability for the given value, NOT taking its predictability into account.
 java.util.Set<KotlinType> getPossibleTypes(DataFlowValue key)
          IMPORTANT: by default, the original (native) type for this value are NOT included.
 Nullability getPredictableNullability(DataFlowValue key)
          Returns collected nullability for the given value if it's predictable.
 DataFlowInfo or(DataFlowInfo other)
          Call this function to choose data flow information common for this and other and return it as the result
 

Field Detail

EMPTY

static final DataFlowInfo EMPTY
Method Detail

getCompleteNullabilityInfo

@NotNull
java.util.Map<DataFlowValue,Nullability> getCompleteNullabilityInfo()

getCompleteTypeInfo

@NotNull
com.google.common.collect.SetMultimap<DataFlowValue,KotlinType> getCompleteTypeInfo()

getNullability

@NotNull
Nullability getNullability(@NotNull
                                   DataFlowValue key)
Returns collected nullability for the given value, NOT taking its predictability into account.


getPredictableNullability

@NotNull
Nullability getPredictableNullability(@NotNull
                                              DataFlowValue key)
Returns collected nullability for the given value if it's predictable. Otherwise basic value nullability is returned


getPossibleTypes

@NotNull
java.util.Set<KotlinType> getPossibleTypes(@NotNull
                                                   DataFlowValue key)
IMPORTANT: by default, the original (native) type for this value are NOT included. So it's quite possible to get an empty set here.


clearValueInfo

@NotNull
DataFlowInfo clearValueInfo(@NotNull
                                    DataFlowValue value)
Call this function to clear all data flow information about the given data flow value. Useful when we are not sure how this value can be changed, e.g. in a loop.


assign

@NotNull
DataFlowInfo assign(@NotNull
                            DataFlowValue a,
                            @NotNull
                            DataFlowValue b)
Call this function when b is assigned to a


equate

@NotNull
DataFlowInfo equate(@NotNull
                            DataFlowValue a,
                            @NotNull
                            DataFlowValue b)
Call this function when it's known than a == b


disequate

@NotNull
DataFlowInfo disequate(@NotNull
                               DataFlowValue a,
                               @NotNull
                               DataFlowValue b)
Call this function when it's known than a != b


establishSubtyping

@NotNull
DataFlowInfo establishSubtyping(@NotNull
                                        DataFlowValue value,
                                        @NotNull
                                        KotlinType type)

and

@NotNull
DataFlowInfo and(@NotNull
                         DataFlowInfo other)
Call this function to add data flow information from other to this and return sum as the result


or

@NotNull
DataFlowInfo or(@NotNull
                        DataFlowInfo other)
Call this function to choose data flow information common for this and other and return it as the result