Class ResolvedFeature
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate<Expression>
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractResolvedReference<XAbstractFeatureCall>
-
- org.eclipse.xtext.xbase.typesystem.internal.ResolvedFeature
-
- All Implemented Interfaces:
IApplicableCandidate,IFeatureLinkingCandidate,ILinkingCandidate
public class ResolvedFeature extends AbstractResolvedReference<XAbstractFeatureCall> implements IFeatureLinkingCandidate
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
AbstractLinkingCandidate.ArgumentTypeComputationState, AbstractLinkingCandidate.ObservableTypeExpectation
-
-
Field Summary
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractResolvedReference
resolvedElement
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
arguments, typeArguments
-
-
Constructor Summary
Constructors Constructor Description ResolvedFeature(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement feature, FeatureLinkHelper helper, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyToComputationState()Apply this candidate to the current computation state model.protected voidcomputeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)protected java.util.List<XExpression>getArguments()protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument>getDeclaratorParameterMapping()protected LightweightTypeReferencegetDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)XAbstractFeatureCallgetFeatureCall()Returns the feature call that is linked.protected XExpressiongetImplicitFirstArgument()protected LightweightTypeReferencegetImplicitFirstArgumentType()protected XExpressiongetImplicitReceiver()protected LightweightTypeReferencegetImplicitReceiverType()protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference>getPlainSyntacticTypeArguments()ILinkingCandidategetPreferredCandidate(ILinkingCandidate other)Produces the best candidate for the current two candidates.protected XExpressiongetReceiver()protected LightweightTypeReferencegetReceiverType()protected LightweightTypeReferencegetSubstitutedExpectedType(int idx)Returns the substituted expected type for the argument atargumentIndex.protected java.util.List<XExpression>getSyntacticArguments()For testing purposeprotected XExpressiongetSyntacticReceiver()protected LightweightTypeReferencegetSyntacticReceiverType()protected booleanhasReceiver()Returnstrueif the argument at index 0 will be considered as the receiver.booleanisExtension()Returnstrueif the linked feature is contributed by an extension.protected booleanisRawTypeContext()booleanisStatic()Returnstrueif the linked feature is static.booleanisTypeLiteral()Returnstrueif the feature call is linked as a type literal.protected voidresolveAgainstActualType(LightweightTypeReference declaredType, LightweightTypeReference actualType, AbstractTypeComputationState state)protected voidresolveArgumentType(XExpression argument, LightweightTypeReference declaredType, ITypeComputationState argumentState)protected voidresolveKnownArgumentType(XExpression argument, LightweightTypeReference knownType, LightweightTypeReference declaredType, ITypeComputationState argumentState)-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractResolvedReference
applyToModel, getFeature, getTypeParameterMapping, toString, validate
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
accept, computeArgumentType, computeArgumentTypes, computeFixedArityArgumentType, createArgumentTypeSubstitutor, createLinkingTypeComputationState, createVarArgTypeComputationState, deferredBindTypeArgument, discardRefinementTypeIfReassigned, getActualType, getActualType, getDeclaredTypeParameters, getExpectedType, getExpression, getState, getSyntacticTypeArguments, getTypeArguments, initializeArgumentTypeComputation, initializeConstraintMapping, initializeMapping, initializeTypeParameterMapping, initializeTypeParameterMapping, isBoundTypeArgumentSkipped, mustDiscardRefinement, preApply
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.computation.IApplicableCandidate
validate
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.computation.ILinkingCandidate
applyToModel, getExpression, getFeature, getTypeArguments
-
-
-
-
Constructor Detail
-
ResolvedFeature
public ResolvedFeature(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement feature, FeatureLinkHelper helper, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
-
Method Detail
-
getPreferredCandidate
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
Description copied from interface:ILinkingCandidateProduces the best candidate for the current two candidates. It may turn out that both candidates (thisandother) are ambiguous so no prefered candidate can be chosen. In that case, a new linking candidate may be produced that carries this information and will use that onILinkingCandidate.applyToComputationState(),ILinkingCandidate.applyToModel(IResolvedTypes), andIApplicableCandidate.validate(IAcceptor).- Specified by:
getPreferredCandidatein interfaceILinkingCandidate
-
getSubstitutedExpectedType
protected LightweightTypeReference getSubstitutedExpectedType(int idx)
Description copied from class:AbstractLinkingCandidateReturns the substituted expected type for the argument atargumentIndex. If the expected type is an unbound type parameter, a reference to the type parameter itself is returned.- Overrides:
getSubstitutedExpectedTypein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
applyToComputationState
public void applyToComputationState()
Description copied from interface:ILinkingCandidateApply this candidate to the current computation state model. This propagates the type information about arguments and child expressions to the currently active resolution state.- Specified by:
applyToComputationStatein interfaceILinkingCandidate- Overrides:
applyToComputationStatein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
isRawTypeContext
protected boolean isRawTypeContext()
- Overrides:
isRawTypeContextin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
resolveAgainstActualType
protected void resolveAgainstActualType(LightweightTypeReference declaredType, LightweightTypeReference actualType, AbstractTypeComputationState state)
- Overrides:
resolveAgainstActualTypein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getArguments
protected java.util.List<XExpression> getArguments()
- Specified by:
getArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getFeatureCall
public XAbstractFeatureCall getFeatureCall()
Description copied from interface:IFeatureLinkingCandidateReturns the feature call that is linked.- Specified by:
getFeatureCallin interfaceIFeatureLinkingCandidate- Returns:
- the feature call.
-
getPlainSyntacticTypeArguments
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference> getPlainSyntacticTypeArguments()
- Specified by:
getPlainSyntacticTypeArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
computeVarArgumentType
protected void computeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)
- Overrides:
computeVarArgumentTypein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
resolveArgumentType
protected void resolveArgumentType(XExpression argument, LightweightTypeReference declaredType, ITypeComputationState argumentState)
- Overrides:
resolveArgumentTypein classAbstractLinkingCandidate<XAbstractFeatureCall>- Parameters:
argument- the expression that should be processed.declaredType- the declared (expected) type for the given expression.argumentState- the to-be-used state to compute the actual type of the argument. It is already configured with the expectation.
-
resolveKnownArgumentType
protected void resolveKnownArgumentType(XExpression argument, LightweightTypeReference knownType, LightweightTypeReference declaredType, ITypeComputationState argumentState)
-
getDeclaratorParameterMapping
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> getDeclaratorParameterMapping()
- Overrides:
getDeclaratorParameterMappingin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredType
protected LightweightTypeReference getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
- Overrides:
getDeclaredTypein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getImplicitReceiver
protected XExpression getImplicitReceiver()
-
getImplicitReceiverType
protected LightweightTypeReference getImplicitReceiverType()
-
getImplicitFirstArgument
protected XExpression getImplicitFirstArgument()
-
getImplicitFirstArgumentType
protected LightweightTypeReference getImplicitFirstArgumentType()
-
getReceiver
protected XExpression getReceiver()
-
getReceiverType
protected LightweightTypeReference getReceiverType()
-
getSyntacticReceiver
protected XExpression getSyntacticReceiver()
-
getSyntacticReceiverType
protected LightweightTypeReference getSyntacticReceiverType()
-
getSyntacticArguments
protected java.util.List<XExpression> getSyntacticArguments()
For testing purpose
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is contributed by an extension.- Specified by:
isExtensionin interfaceIFeatureLinkingCandidate- Returns:
- whether the feature is extension.
-
hasReceiver
protected boolean hasReceiver()
Description copied from class:AbstractLinkingCandidateReturnstrueif the argument at index 0 will be considered as the receiver.- Overrides:
hasReceiverin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
isStatic
public boolean isStatic()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is static.- Specified by:
isStaticin interfaceIFeatureLinkingCandidate- Returns:
- whether the feature is static.
-
isTypeLiteral
public boolean isTypeLiteral()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the feature call is linked as a type literal.- Specified by:
isTypeLiteralin interfaceIFeatureLinkingCandidate- Overrides:
isTypeLiteralin classAbstractLinkingCandidate<XAbstractFeatureCall>- Returns:
- whether the feature call is a type literal rather than a real feature call.
-
-