Interface ITypeComputationResult
-
- All Known Implementing Classes:
NoTypeResult
,ResolutionBasedComputationResult
public interface ITypeComputationResult
The result of the type computation for a given expression. This result may be a lazy result, thus the real type is determined whengetActualExpressionType()
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 1
The 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LightweightTypeReference
getActualExpressionType()
Returns the type of the expression (if known).int
getCheckedConformanceFlags()
Conformance information about the actual expression type and the expectation.java.util.EnumSet<ConformanceHint>
getCheckedConformanceHints()
Conformance information about the actual expression type and the expectation.int
getConformanceFlags()
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).
-
-
-
Method Detail
-
getActualExpressionType
LightweightTypeReference getActualExpressionType()
Returns the type of the expression (if known). May returnnull
.
-
getExpectedExpressionType
LightweightTypeReference getExpectedExpressionType()
Returns the type of the expectation (if any). TODO expose theITypeExpectation
instead which carries more information.
-
getReturnType
LightweightTypeReference getReturnType()
Returns the return type of the expression (if known). May returnnull
. The return type is different from theactual type
since its value escapes the current context.
-
getExpectedReturnType
LightweightTypeReference getExpectedReturnType()
Returns the type of the return expectation (if any). TODO expose theITypeExpectation
instead which carries more information.
-
getExpression
XExpression getExpression()
The expression that is associated with this result.
-
getConformanceHints
java.util.EnumSet<ConformanceHint> getConformanceHints()
Conformance information about the actual expression type and the expectation.
-
getConformanceFlags
int getConformanceFlags()
Conformance information about the actual expression type and the expectation.
-
getCheckedConformanceHints
java.util.EnumSet<ConformanceHint> getCheckedConformanceHints()
Conformance information about the actual expression type and the expectation.
-
getCheckedConformanceFlags
int getCheckedConformanceFlags()
Conformance information about the actual expression type and the expectation.
-
-