public class ExpressionTypeComputationState extends AbstractStackedTypeComputationState
Modifier and Type | Class and Description |
---|---|
protected class |
ExpressionTypeComputationState.ExpressionAwareTypeCheckpointComputationState |
Modifier and Type | Field and Description |
---|---|
protected XExpression |
expression |
resolvedTypes
Modifier | Constructor and Description |
---|---|
protected |
ExpressionTypeComputationState(StackedResolvedTypes resolvedTypes,
IFeatureScopeSession featureScopeSession,
AbstractTypeComputationState parent,
XExpression expression) |
Modifier and Type | Method and Description |
---|---|
protected LightweightTypeReference |
acceptType(ResolvedTypes resolvedTypes,
AbstractTypeExpectation expectation,
LightweightTypeReference type,
boolean returnType,
int flags) |
protected LightweightTypeReference |
acceptType(XExpression expression,
ResolvedTypes resolvedTypes,
AbstractTypeExpectation expectation,
LightweightTypeReference type,
boolean returnType,
int flags) |
protected IFeatureLinkingCandidate |
createResolvedLink(XAbstractFeatureCall featureCall,
JvmIdentifiableElement resolvedTo) |
protected ExpressionAwareStackedResolvedTypes |
doComputeTypes(XExpression expression) |
protected StackedResolvedTypes |
getStackedResolvedTypes() |
protected boolean |
isImplicitFirstArgument(XAbstractFeatureCall featureCall) |
protected boolean |
isImplicitReceiver(XAbstractFeatureCall featureCall) |
protected boolean |
isInstanceContext() |
protected void |
markAsPropagated() |
protected void |
markAsRefinedTypeIfNecessary(IFeatureLinkingCandidate candidate) |
protected ExpressionAwareStackedResolvedTypes |
pushTypes(XExpression expression) |
TypeComputationStateWithExpectation |
withExpectation(LightweightTypeReference expectation)
The given expectation will be resolved if it contains unresolved type
arguments, e.g. an operation that declares two parameters of the very
same type argument will yield a more detailed expectation if possible.
|
AbstractTypeComputationState |
withoutExpectation()
Keeps the return type expectation.
|
TypeCheckpointComputationState |
withTypeCheckpoint(org.eclipse.emf.ecore.EObject context)
A type checkpoint allows to re-specify the type of an identifiable that was already
type-computed.
|
getExpectations, getParent, getReturnExpectations
acceptActualType, acceptActualType, acceptActualType, acceptActualType, acceptCandidate, addDiagnostic, addExtensionsToCurrentScope, addExtensionToCurrentScope, addImports, addLocalToCurrentScope, addLocalToCurrentScope, addTypeToStaticExtensionImportScope, addTypeToStaticImportScope, afterScope, assignType, assignType, assignType, assignTypes, computeTypes, createCandidate, createCandidate, createCandidateWithReceiverType, createExpressionComputationState, createResolvedLink, createTypeAssigner, createUnboundTypeReference, discardReassignedTypes, getExpectations, getExpectedExceptions, getFeatureScopeSession, getLinkingCandidates, getLinkingCandidates, getReferenceOwner, getResolvedTypes, getResolver, getReturnExpectations, getSeverities, getSeverity, getSingleExpectation, getTypeComputer, getTypeReferences, isIgnored, reassignType, refineExpectedType, rewriteScope, toIdentifiableDescription, toString, withExpectedExceptions, withinScope, withNonVoidExpectation, withNonVoidExpectation, withoutRootExpectation, withReturnExpectation, withRootExpectation
protected final XExpression expression
protected ExpressionTypeComputationState(StackedResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession, AbstractTypeComputationState parent, XExpression expression)
protected ExpressionAwareStackedResolvedTypes doComputeTypes(XExpression expression)
doComputeTypes
in class AbstractTypeComputationState
protected void markAsPropagated()
protected void markAsRefinedTypeIfNecessary(IFeatureLinkingCandidate candidate)
protected ExpressionAwareStackedResolvedTypes pushTypes(XExpression expression)
pushTypes
in class AbstractTypeComputationState
protected LightweightTypeReference acceptType(ResolvedTypes resolvedTypes, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)
acceptType
in class AbstractStackedTypeComputationState
protected LightweightTypeReference acceptType(XExpression expression, ResolvedTypes resolvedTypes, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)
acceptType
in class AbstractStackedTypeComputationState
public TypeComputationStateWithExpectation withExpectation(LightweightTypeReference expectation)
ITypeComputationState
<T> T foo(T, T)
with
foo<String>(null, 'string')
will allow to pass the unresolved T
as expectation
where clients would be invoked with the better candidate 'string'.withExpectation
in interface ITypeComputationState
withExpectation
in class AbstractTypeComputationState
public AbstractTypeComputationState withoutExpectation()
ITypeComputationState
{ someExpression subsequent }The expectation for the call to
someExpression
does not have any actual expectations.withoutExpectation
in interface ITypeComputationState
withoutExpectation
in class AbstractTypeComputationState
public TypeCheckpointComputationState withTypeCheckpoint(org.eclipse.emf.ecore.EObject context)
ITypeComputationState
withTypeCheckpoint
in interface ITypeComputationState
withTypeCheckpoint
in class AbstractTypeComputationState
context
- an indicator that describes the context of this type checkpoint, e.g. an XCasePart
.protected IFeatureLinkingCandidate createResolvedLink(XAbstractFeatureCall featureCall, JvmIdentifiableElement resolvedTo)
createResolvedLink
in class AbstractTypeComputationState
protected boolean isImplicitReceiver(XAbstractFeatureCall featureCall)
protected boolean isImplicitFirstArgument(XAbstractFeatureCall featureCall)
protected boolean isInstanceContext()
protected StackedResolvedTypes getStackedResolvedTypes()