Class ExpressionTypeComputationState
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractStackedTypeComputationState
-
- org.eclipse.xtext.xbase.typesystem.internal.ExpressionTypeComputationState
-
- All Implemented Interfaces:
ITypeComputationState
- Direct Known Subclasses:
RootExpressionTypeComputationState
public class ExpressionTypeComputationState extends AbstractStackedTypeComputationState
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classExpressionTypeComputationState.ExpressionAwareTypeCheckpointComputationState
-
Field Summary
Fields Modifier and Type Field Description protected XExpressionexpression-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState
resolvedTypes
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExpressionTypeComputationState(StackedResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession, AbstractTypeComputationState parent, XExpression expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LightweightTypeReferenceacceptType(ResolvedTypes resolvedTypes, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)protected LightweightTypeReferenceacceptType(XExpression expression, ResolvedTypes resolvedTypes, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)protected IFeatureLinkingCandidatecreateResolvedLink(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement resolvedTo)protected ExpressionAwareStackedResolvedTypesdoComputeTypes(XExpression expression)protected StackedResolvedTypesgetStackedResolvedTypes()protected booleanisImplicitFirstArgument(XAbstractFeatureCall featureCall)protected booleanisImplicitReceiver(XAbstractFeatureCall featureCall)protected booleanisInstanceContext()protected voidmarkAsPropagated()protected voidmarkAsRefinedTypeIfNecessary(IFeatureLinkingCandidate candidate)protected ExpressionAwareStackedResolvedTypespushTypes(XExpression expression)TypeComputationStateWithExpectationwithExpectation(LightweightTypeReference expectation)The given expectation will be resolved if it contains unresolved type arguments, e.g.AbstractTypeComputationStatewithoutExpectation()Keeps the return type expectation.TypeCheckpointComputationStatewithTypeCheckpoint(org.eclipse.emf.ecore.EObject context)A type checkpoint allows to re-specify the type of an identifiable that was already type-computed.-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractStackedTypeComputationState
getExpectations, getParent, getReturnExpectations
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState
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
-
-
-
-
Field Detail
-
expression
protected final XExpression expression
-
-
Constructor Detail
-
ExpressionTypeComputationState
protected ExpressionTypeComputationState(StackedResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession, AbstractTypeComputationState parent, XExpression expression)
-
-
Method Detail
-
doComputeTypes
protected ExpressionAwareStackedResolvedTypes doComputeTypes(XExpression expression)
- Overrides:
doComputeTypesin classAbstractTypeComputationState
-
markAsPropagated
protected void markAsPropagated()
-
markAsRefinedTypeIfNecessary
protected void markAsRefinedTypeIfNecessary(IFeatureLinkingCandidate candidate)
-
pushTypes
protected ExpressionAwareStackedResolvedTypes pushTypes(XExpression expression)
- Overrides:
pushTypesin classAbstractTypeComputationState
-
acceptType
protected LightweightTypeReference acceptType(ResolvedTypes resolvedTypes, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)
- Overrides:
acceptTypein classAbstractStackedTypeComputationState
-
acceptType
protected LightweightTypeReference acceptType(XExpression expression, ResolvedTypes resolvedTypes, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)
- Overrides:
acceptTypein classAbstractStackedTypeComputationState
-
withExpectation
public TypeComputationStateWithExpectation withExpectation(LightweightTypeReference expectation)
Description copied from interface:ITypeComputationStateThe 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.<T> T foo(T, T)withfoo<String>(null, 'string')will allow to pass the unresolvedTas expectation where clients would be invoked with the better candidate 'string'.- Specified by:
withExpectationin interfaceITypeComputationState- Overrides:
withExpectationin classAbstractTypeComputationState
-
withoutExpectation
public AbstractTypeComputationState withoutExpectation()
Description copied from interface:ITypeComputationStateKeeps the return type expectation. Otherwise the new state does not have any expectations. Example:{ someExpression subsequent }The expectation for the call tosomeExpressiondoes not have any actual expectations.- Specified by:
withoutExpectationin interfaceITypeComputationState- Overrides:
withoutExpectationin classAbstractTypeComputationState
-
withTypeCheckpoint
public TypeCheckpointComputationState withTypeCheckpoint(org.eclipse.emf.ecore.EObject context)
Description copied from interface:ITypeComputationStateA type checkpoint allows to re-specify the type of an identifiable that was already type-computed. The refined type is discarded as soon as the state is left. In that sense, the type checkpoint describes the scope of certain type specializations.- Specified by:
withTypeCheckpointin interfaceITypeComputationState- Overrides:
withTypeCheckpointin classAbstractTypeComputationState- Parameters:
context- an indicator that describes the context of this type checkpoint, e.g. anXCasePart.
-
createResolvedLink
protected IFeatureLinkingCandidate createResolvedLink(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement resolvedTo)
- Overrides:
createResolvedLinkin classAbstractTypeComputationState
-
isImplicitReceiver
protected boolean isImplicitReceiver(XAbstractFeatureCall featureCall)
-
isImplicitFirstArgument
protected boolean isImplicitFirstArgument(XAbstractFeatureCall featureCall)
-
isInstanceContext
protected boolean isInstanceContext()
-
getStackedResolvedTypes
protected StackedResolvedTypes getStackedResolvedTypes()
-
-