public interface ITypeComputationResult
getActualExpressionType()
or other properties are
queried.
A type computation result distinguishes between return types and actual
types for expressions.
Consider the following scenario:
val x = if (guard) return 'dummy' else 1The return type of theif expression
is the typeComparable<?> & Serializable
while the actual type of the conditional expression is typeint
. The first branch of the condition will never complete normally thus its type is not considered for the local expression type computation.
Modifier and Type | Method and Description |
---|---|
LightweightTypeReference |
getActualExpressionType()
Returns the type of the expression (if known).
|
java.util.EnumSet<ConformanceHint> |
getCheckedConformanceHints()
Conformance information about the actual expression type and
the expectation.
|
java.util.EnumSet<ConformanceHint> |
getConformanceHints()
Conformance information about the actual expression type and
the expectation.
|
LightweightTypeReference |
getExpectedExpressionType()
Returns the type of the expectation (if any).
|
LightweightTypeReference |
getExpectedReturnType()
Returns the type of the return expectation (if any).
|
XExpression |
getExpression()
The expression that is associated with this result.
|
LightweightTypeReference |
getReturnType()
Returns the return type of the expression (if known).
|
@Nullable LightweightTypeReference getActualExpressionType()
null
.@Nullable LightweightTypeReference getExpectedExpressionType()
ITypeExpectation
instead which carries more information.@Nullable LightweightTypeReference getReturnType()
null
. The return type is different
from the actual type
since
its value escapes the current context.@Nullable LightweightTypeReference getExpectedReturnType()
ITypeExpectation
instead which carries more information.@Nullable XExpression getExpression()
@NonNull java.util.EnumSet<ConformanceHint> getConformanceHints()
@NonNull java.util.EnumSet<ConformanceHint> getCheckedConformanceHints()