public class ResolvedFeature extends AbstractResolvedReference<XAbstractFeatureCall> implements IFeatureLinkingCandidate
AbstractLinkingCandidate.ArgumentTypeComputationState, AbstractLinkingCandidate.ObservableTypeExpectation
resolvedElement
arguments, typeArguments
Constructor and Description |
---|
ResolvedFeature(XAbstractFeatureCall featureCall,
JvmIdentifiableElement feature,
FeatureLinkHelper helper,
ITypeExpectation expectation,
ExpressionTypeComputationState state) |
Modifier and Type | Method and Description |
---|---|
void |
applyToComputationState()
Apply this candidate to the current computation state model.
|
protected void |
computeVarArgumentType(IFeatureCallArgumentSlot slot,
TypeParameterSubstitutor<?> substitutor) |
protected java.util.List<XExpression> |
getArguments() |
protected java.util.Map<JvmTypeParameter,LightweightMergedBoundTypeArgument> |
getDeclaratorParameterMapping() |
protected LightweightTypeReference |
getDeclaredType(JvmIdentifiableElement feature) |
XAbstractFeatureCall |
getFeatureCall()
Returns the feature call that is linked.
|
protected XExpression |
getImplicitFirstArgument() |
protected LightweightTypeReference |
getImplicitFirstArgumentType() |
protected XExpression |
getImplicitReceiver() |
protected LightweightTypeReference |
getImplicitReceiverType() |
protected java.util.List<JvmTypeReference> |
getPlainSyntacticTypeArguments() |
ILinkingCandidate |
getPreferredCandidate(ILinkingCandidate other)
Produces the best candidate for the current two candidates.
|
protected XExpression |
getReceiver() |
protected LightweightTypeReference |
getReceiverType() |
protected LightweightTypeReference |
getSubstitutedExpectedType(int idx)
Returns the substituted expected type for the argument at
argumentIndex . |
protected java.util.List<XExpression> |
getSyntacticArguments()
For testing purpose
|
protected XExpression |
getSyntacticReceiver() |
protected LightweightTypeReference |
getSyntacticReceiverType() |
protected boolean |
hasReceiver()
Returns
true if the argument at index 0 will be considered as the receiver. |
boolean |
isExtension()
Returns
true if the the linked feature is contributed
by an extension. |
protected boolean |
isRawTypeContext() |
boolean |
isStatic()
Returns
true if the the linked feature is static. |
boolean |
isTypeLiteral()
Returns
true if the the feature call is linked as a type literal. |
protected void |
resolveAgainstActualType(LightweightTypeReference declaredType,
LightweightTypeReference actualType,
AbstractTypeComputationState state) |
protected void |
resolveArgumentType(XExpression argument,
LightweightTypeReference declaredType,
ITypeComputationState argumentState) |
protected void |
resolveKnownArgumentType(XExpression argument,
LightweightTypeReference knownType,
LightweightTypeReference declaredType,
ITypeComputationState argumentState) |
applyToModel, getFeature, getTypeParameterMapping, toString, validate
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
applyToModel, getExpression, getFeature, getTypeArguments
validate
public ResolvedFeature(XAbstractFeatureCall featureCall, JvmIdentifiableElement feature, FeatureLinkHelper helper, ITypeExpectation expectation, ExpressionTypeComputationState state)
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
ILinkingCandidate
this
and other
) 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 on ILinkingCandidate.applyToComputationState()
,
ILinkingCandidate.applyToModel(IResolvedTypes)
, and IApplicableCandidate.validate(IAcceptor)
.getPreferredCandidate
in interface ILinkingCandidate
protected LightweightTypeReference getSubstitutedExpectedType(int idx)
AbstractLinkingCandidate
argumentIndex
.
If the expected type is an unbound type parameter, a reference to the type parameter
itself is returned.getSubstitutedExpectedType
in class AbstractLinkingCandidate<XAbstractFeatureCall>
public void applyToComputationState()
ILinkingCandidate
applyToComputationState
in interface ILinkingCandidate
applyToComputationState
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected boolean isRawTypeContext()
isRawTypeContext
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected void resolveAgainstActualType(LightweightTypeReference declaredType, LightweightTypeReference actualType, AbstractTypeComputationState state)
resolveAgainstActualType
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected java.util.List<XExpression> getArguments()
getArguments
in class AbstractLinkingCandidate<XAbstractFeatureCall>
public XAbstractFeatureCall getFeatureCall()
IFeatureLinkingCandidate
getFeatureCall
in interface IFeatureLinkingCandidate
protected java.util.List<JvmTypeReference> getPlainSyntacticTypeArguments()
getPlainSyntacticTypeArguments
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected void computeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)
computeVarArgumentType
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected void resolveArgumentType(XExpression argument, LightweightTypeReference declaredType, ITypeComputationState argumentState)
resolveArgumentType
in class AbstractLinkingCandidate<XAbstractFeatureCall>
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.protected void resolveKnownArgumentType(XExpression argument, LightweightTypeReference knownType, LightweightTypeReference declaredType, ITypeComputationState argumentState)
protected java.util.Map<JvmTypeParameter,LightweightMergedBoundTypeArgument> getDeclaratorParameterMapping()
getDeclaratorParameterMapping
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected LightweightTypeReference getDeclaredType(JvmIdentifiableElement feature)
getDeclaredType
in class AbstractLinkingCandidate<XAbstractFeatureCall>
protected XExpression getImplicitReceiver()
protected LightweightTypeReference getImplicitReceiverType()
protected XExpression getImplicitFirstArgument()
protected LightweightTypeReference getImplicitFirstArgumentType()
protected XExpression getReceiver()
protected LightweightTypeReference getReceiverType()
protected XExpression getSyntacticReceiver()
protected LightweightTypeReference getSyntacticReceiverType()
protected java.util.List<XExpression> getSyntacticArguments()
public boolean isExtension()
IFeatureLinkingCandidate
true
if the the linked feature is contributed
by an extension.isExtension
in interface IFeatureLinkingCandidate
protected boolean hasReceiver()
AbstractLinkingCandidate
true
if the argument at index 0 will be considered as the receiver.hasReceiver
in class AbstractLinkingCandidate<XAbstractFeatureCall>
public boolean isStatic()
IFeatureLinkingCandidate
true
if the the linked feature is static.isStatic
in interface IFeatureLinkingCandidate
public boolean isTypeLiteral()
IFeatureLinkingCandidate
true
if the the feature call is linked as a type literal.isTypeLiteral
in interface IFeatureLinkingCandidate
isTypeLiteral
in class AbstractLinkingCandidate<XAbstractFeatureCall>