Class FeatureLinkingCandidate
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate<Expression>
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
- org.eclipse.xtext.xbase.typesystem.internal.FeatureLinkingCandidate
-
- All Implemented Interfaces:
IFeatureNames
,IApplicableCandidate
,IFeatureLinkingCandidate
,ILinkingCandidate
public class FeatureLinkingCandidate extends AbstractPendingLinkingCandidate<XAbstractFeatureCall> implements IFeatureLinkingCandidate, IFeatureNames
A linking candidate that represents a feature call and allows to resolve overloaded members.
-
-
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.AbstractPendingLinkingCandidate
description
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
arguments, typeArguments
-
Fields inherited from interface org.eclipse.xtext.xbase.scoping.batch.IFeatureNames
IT, SELF, SUPER, THIS
-
-
Constructor Summary
Constructors Constructor Description FeatureLinkingCandidate(XAbstractFeatureCall featureCall, IIdentifiableElementDescription description, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyImplicitReceiver()
void
applyToModel(IResolvedTypes resolvedTypes)
Injects the resolved feature into the model with the same semantics as the implicitresolve
of EMF.protected CandidateCompareResult
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right)
protected CandidateCompareResult
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right, boolean recompute)
protected CandidateCompareResult
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right, int leftBoxing, int rightBoxing, int leftDemand, int rightDemand)
Compare this linking candidate with the givenother
candidate atargumentIndex
ReturnsCandidateCompareResult#THIS
if this candidate is better,CandidateCompareResult#OTHER
if the right candidate was better,CandidateCompareResult#AMBIGUOUS
if both candidates are valid but ambiguous orCandidateCompareResult#EQUALLY_INVALID
if both candidates are ambiguous but erroneous.protected CandidateCompareResult
compareByArgumentTypes(FeatureLinkingCandidate right, int leftBoxing, int rightBoxing)
protected CandidateCompareResult
compareByArgumentTypesAndStaticFlag(FeatureLinkingCandidate right, int leftBoxing, int rightBoxing)
protected CandidateCompareResult
compareByArgumentTypesFlags(AbstractPendingLinkingCandidate<?> right, int leftIdx, int rightIdx, int leftConformance, int rightConformance)
Compare this linking candidate with the givenother
candidate atleftIdx
andrightIdx
respectively.protected CandidateCompareResult
compareByArityWith(AbstractPendingLinkingCandidate<?> right)
protected CandidateCompareResult
compareByAssignmentName(AbstractPendingLinkingCandidate<?> right)
protected CandidateCompareResult
compareByBucket(AbstractPendingLinkingCandidate<?> right)
protected CandidateCompareResult
compareByName(AbstractPendingLinkingCandidate<?> right)
protected CandidateCompareResult
compareByNameAndStaticFlag(AbstractPendingLinkingCandidate<?> right)
protected CandidateCompareResult
compareTo(AbstractPendingLinkingCandidate<?> right, boolean invalid)
ReturnsCandidateCompareResult#THIS
if this candidate is better,CandidateCompareResult#OTHER
if the right candidate was better,CandidateCompareResult#AMBIGUOUS
if both candidates are valid but ambiguous orCandidateCompareResult#EQUALLY_INVALID
if both candidates are ambiguous but erroneous.protected void
computeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)
protected ILinkingCandidate
createAmbiguousLinkingCandidate(AbstractPendingLinkingCandidate<?> second)
Produce a candidate that carries the information about ambiguous candidates.protected java.util.List<XExpression>
createArgumentList(XExpression head, java.util.List<XExpression> tail)
protected ILinkingCandidate
createSuspiciousLinkingCandidate(AbstractPendingLinkingCandidate<?> chosenCandidate)
Produce a candidate that carries the information about suspicious overload resolution where a member on 'this' wins over a member on 'it'.protected java.util.List<XExpression>
getArguments()
Returns the actual arguments of the expression.protected int
getConformanceFlags(int idx, boolean recompute)
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument>
getDeclaratorParameterMapping()
protected LightweightTypeReference
getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
protected CandidateCompareResult
getExpectedTypeCompareResultOther(AbstractPendingLinkingCandidate<?> right)
Returns the compare result for the declared parameter types if the given other candidate had won.XAbstractFeatureCall
getFeatureCall()
Returns the feature call that is linked.protected java.lang.String
getFeatureTypeName()
Returns the name of the feature type, e.g.protected XExpression
getFirstArgument()
Returns the first argument if this is an extension.protected LightweightTypeReference
getFirstArgumentType()
protected XExpression
getImplicitFirstArgument()
protected LightweightTypeReference
getImplicitFirstArgumentType()
protected XExpression
getImplicitReceiver()
protected LightweightTypeReference
getImplicitReceiverType()
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference>
getPlainSyntacticTypeArguments()
protected XExpression
getReceiver()
protected int
getReceiverConformanceFlags()
protected LightweightTypeReference
getReceiverType()
protected LightweightTypeReference
getSubstitutedExpectedType(int idx)
Returns the substituted expected type for the argument atargumentIndex
.protected java.util.List<XExpression>
getSyntacticArguments()
protected XExpression
getSyntacticReceiver()
protected XExpression
getSyntacticReceiverIfPossibleArgument()
Returns the syntactic receiver if it is an expression.protected LightweightTypeReference
getSyntacticReceiverType()
protected org.eclipse.xtext.diagnostics.Severity
getUnhandledExceptionSeverity(org.eclipse.xtext.common.types.JvmExecutable executable)
Obtain the currently applicable severity for uncaught exceptions.protected boolean
hasReceiver()
Returnstrue
if the argument at index 0 will be considered as the receiver.protected void
initializeMapping(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter, java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> result)
protected boolean
isAmbiguousExtensionProvider(AbstractPendingLinkingCandidate<?> right)
protected boolean
isAssignmentOrMemberFeatureCall()
protected boolean
isCompoundOperator()
protected boolean
isExplicitOperationCall()
boolean
isExtension()
Returnstrue
if the linked feature is contributed by an extension.protected boolean
isFirstArgument(int argumentIndex)
protected boolean
isGetClass(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
protected boolean
isGetClassOnTypeLiteral()
Returnstrue
if the methodObject.getClass()
is bound and the receiver is a type literal.protected boolean
isImplicitlyStatic(XAssignment assignment)
protected boolean
isInvalidStaticSyntax()
Returnstrue
if a static member is accessed with an instance receiver, e.g.protected boolean
isLambdaExpression(int argumentIdx)
protected boolean
isOperationCallSyntax()
protected boolean
isRawTypeContext()
protected boolean
isReassignFirstArgument(XAbstractFeatureCall featureCall)
protected boolean
isSimpleAssignment(XAssignment assignment)
boolean
isStatic()
Returnstrue
if the linked feature is static.protected boolean
isStaticAccessSyntax()
protected boolean
isStaticWithDeclaringType()
protected boolean
isStaticWithDeclaringType(XAssignment assignment)
protected boolean
isSyntacticReceiverPossibleArgument()
Returnstrue
if the linked receiver could be a possible argument of this feature.boolean
isTypeLiteral()
Returnstrue
if the feature call is linked as a type literal.protected boolean
isTypeLiteral(XExpression expression)
protected boolean
isValidAssignmentName(IIdentifiableElementDescription description)
protected void
preApply()
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)
boolean
validate(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
Validates this linking candidate and adds respective diagnostics to the given queue.protected boolean
validateArity(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractPendingLinkingCandidate
compareByArity, compareByBoxing, compareByTypeArguments, compareDeclaredTypes, compareExpectedArgumentTypes, compareTo, getArgumentTypesAsString, getArityMismatch, getArityMismatch, getDefaultValidationFeature, getFeature, getFeatureParameterTypesAsString, getFeatureParameterTypesAsString, getFeatureTypeParametersAsString, getInvalidArgumentsValidationFeature, getPreferredCandidate, getSeverity, getSimpleFeatureName, getTypeArgumentConformanceFailures, getTypeArgumentsAsString, getTypeArityMismatch, getTypeParameterAsString, getTypeParameterMapping, isDefiniteEarlyExit, isPossibleFunctionType, isVarArgs, isVisible, resolveLinkingProxy, toString, validateTypeArgumentConformance, validateTypeArity, validateUnhandledExceptions, validateUnhandledExceptions, validateVisibility
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
accept, applyToComputationState, computeArgumentType, computeArgumentTypes, computeFixedArityArgumentType, createArgumentTypeSubstitutor, createLinkingTypeComputationState, createVarArgTypeComputationState, deferredBindTypeArgument, discardRefinementTypeIfReassigned, getActualType, getActualType, getDeclaredTypeParameters, getExpectedType, getExpression, getState, getSyntacticTypeArguments, getTypeArguments, initializeArgumentTypeComputation, initializeConstraintMapping, initializeTypeParameterMapping, initializeTypeParameterMapping, isBoundTypeArgumentSkipped, mustDiscardRefinement
-
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.ILinkingCandidate
applyToComputationState, getExpression, getFeature, getPreferredCandidate, getTypeArguments
-
-
-
-
Constructor Detail
-
FeatureLinkingCandidate
public FeatureLinkingCandidate(XAbstractFeatureCall featureCall, IIdentifiableElementDescription description, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
-
Method Detail
-
createAmbiguousLinkingCandidate
protected ILinkingCandidate createAmbiguousLinkingCandidate(AbstractPendingLinkingCandidate<?> second)
Description copied from class:AbstractPendingLinkingCandidate
Produce a candidate that carries the information about ambiguous candidates.- Specified by:
createAmbiguousLinkingCandidate
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
createSuspiciousLinkingCandidate
protected ILinkingCandidate createSuspiciousLinkingCandidate(AbstractPendingLinkingCandidate<?> chosenCandidate)
Description copied from class:AbstractPendingLinkingCandidate
Produce a candidate that carries the information about suspicious overload resolution where a member on 'this' wins over a member on 'it'.- Overrides:
createSuspiciousLinkingCandidate
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Parameters:
chosenCandidate
- the candidate that was picked.
-
isRawTypeContext
protected boolean isRawTypeContext()
- Overrides:
isRawTypeContext
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
initializeMapping
protected void initializeMapping(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter, java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> result)
- Overrides:
initializeMapping
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getArguments
protected java.util.List<XExpression> getArguments()
Returns the actual arguments of the expression. These do not include the receiver.- Specified by:
getArguments
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
validate
public boolean validate(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
Validates this linking candidate and adds respective diagnostics to the given queue. In addition to the checks that are inherited fromAbstractPendingLinkingCandidate.validate(IAcceptor)
, the candidate is validated according these criteria:syntax for static feature calls
,static context for static members
,- field accessed as a method, e.g. with parentheses,
- usage of
this
orsuper
in an invalid context, - direct invocation of an abstract method,
- attempt to enclose a non-final local variable in a lambda expression,
- reference to a private feature with a subclass instance,
errorprone invocation of getClass()
.
- Specified by:
validate
in interfaceIApplicableCandidate
- Overrides:
validate
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Returns:
true
if further validation should be performed.
-
validateArity
protected boolean validateArity(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
- Overrides:
validateArity
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
isReassignFirstArgument
protected boolean isReassignFirstArgument(XAbstractFeatureCall featureCall)
-
isInvalidStaticSyntax
protected boolean isInvalidStaticSyntax()
Returnstrue
if a static member is accessed with an instance receiver, e.g.myLocalVariable.STATIC_METHOD(..)
ormyLocalVariable.STATIC_FIELD = null
.
-
isStaticWithDeclaringType
protected boolean isStaticWithDeclaringType()
-
isStaticWithDeclaringType
protected boolean isStaticWithDeclaringType(XAssignment assignment)
-
isImplicitlyStatic
protected boolean isImplicitlyStatic(XAssignment assignment)
-
isTypeLiteral
protected boolean isTypeLiteral(XExpression expression)
-
isOperationCallSyntax
protected boolean isOperationCallSyntax()
-
getFeatureTypeName
protected java.lang.String getFeatureTypeName()
Description copied from class:AbstractPendingLinkingCandidate
Returns the name of the feature type, e.g. a feature of typeJvmOperation
may returnmethod
, aXVariableDeclaration
may identify itself aslocal variable
.- Specified by:
getFeatureTypeName
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
isStaticAccessSyntax
protected boolean isStaticAccessSyntax()
-
isAssignmentOrMemberFeatureCall
protected boolean isAssignmentOrMemberFeatureCall()
-
isSimpleAssignment
protected boolean isSimpleAssignment(XAssignment assignment)
-
createArgumentList
protected java.util.List<XExpression> createArgumentList(XExpression head, java.util.List<XExpression> tail)
-
getSyntacticArguments
protected java.util.List<XExpression> getSyntacticArguments()
- Overrides:
getSyntacticArguments
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the linked feature is contributed by an extension.- Specified by:
isExtension
in interfaceIFeatureLinkingCandidate
- Overrides:
isExtension
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Returns:
- whether the feature is extension.
-
hasReceiver
protected boolean hasReceiver()
Description copied from class:AbstractLinkingCandidate
Returnstrue
if the argument at index 0 will be considered as the receiver.- Overrides:
hasReceiver
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
isStatic
public boolean isStatic()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the linked feature is static.- Specified by:
isStatic
in interfaceIFeatureLinkingCandidate
- Returns:
- whether the feature is static.
-
isSyntacticReceiverPossibleArgument
protected boolean isSyntacticReceiverPossibleArgument()
Returnstrue
if the linked receiver could be a possible argument of this feature. Basically it's false if this feature is an error feature, a local variable or a if the receiver is a type literal that's treated as a static qualifier rather than a literal expression.
-
isTypeLiteral
public boolean isTypeLiteral()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the feature call is linked as a type literal.- Specified by:
isTypeLiteral
in interfaceIFeatureLinkingCandidate
- Overrides:
isTypeLiteral
in classAbstractLinkingCandidate<XAbstractFeatureCall>
- Returns:
- whether the feature call is a type literal rather than a real feature call.
-
getExpectedTypeCompareResultOther
protected CandidateCompareResult getExpectedTypeCompareResultOther(AbstractPendingLinkingCandidate<?> right)
Description copied from class:AbstractPendingLinkingCandidate
Returns the compare result for the declared parameter types if the given other candidate had won.- Overrides:
getExpectedTypeCompareResultOther
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Parameters:
right
- the winner of the comparison.
-
getConformanceFlags
protected int getConformanceFlags(int idx, boolean recompute)
- Overrides:
getConformanceFlags
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
isLambdaExpression
protected boolean isLambdaExpression(int argumentIdx)
- Overrides:
isLambdaExpression
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getSubstitutedExpectedType
protected LightweightTypeReference getSubstitutedExpectedType(int idx)
Description copied from class:AbstractLinkingCandidate
Returns 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:
getSubstitutedExpectedType
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
isExplicitOperationCall
protected boolean isExplicitOperationCall()
-
compareByName
protected CandidateCompareResult compareByName(AbstractPendingLinkingCandidate<?> right)
- Overrides:
compareByName
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
compareByArgumentTypes
protected CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right)
- Overrides:
compareByArgumentTypes
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
compareByArgumentTypes
protected CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right, boolean recompute)
- Overrides:
compareByArgumentTypes
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
compareByNameAndStaticFlag
protected CandidateCompareResult compareByNameAndStaticFlag(AbstractPendingLinkingCandidate<?> right)
-
isCompoundOperator
protected boolean isCompoundOperator()
-
compareByBucket
protected CandidateCompareResult compareByBucket(AbstractPendingLinkingCandidate<?> right)
- Overrides:
compareByBucket
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
isAmbiguousExtensionProvider
protected boolean isAmbiguousExtensionProvider(AbstractPendingLinkingCandidate<?> right)
-
compareTo
protected CandidateCompareResult compareTo(AbstractPendingLinkingCandidate<?> right, boolean invalid)
Description copied from class:AbstractPendingLinkingCandidate
ReturnsCandidateCompareResult#THIS
if this candidate is better,CandidateCompareResult#OTHER
if the right candidate was better,CandidateCompareResult#AMBIGUOUS
if both candidates are valid but ambiguous orCandidateCompareResult#EQUALLY_INVALID
if both candidates are ambiguous but erroneous. The invalid flag indicates if we already know that both candidates are equally invalid.- Overrides:
compareTo
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
compareByAssignmentName
protected CandidateCompareResult compareByAssignmentName(AbstractPendingLinkingCandidate<?> right)
-
isValidAssignmentName
protected boolean isValidAssignmentName(IIdentifiableElementDescription description)
-
compareByArityWith
protected CandidateCompareResult compareByArityWith(AbstractPendingLinkingCandidate<?> right)
- Overrides:
compareByArityWith
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
compareByArgumentTypesFlags
protected CandidateCompareResult compareByArgumentTypesFlags(AbstractPendingLinkingCandidate<?> right, int leftIdx, int rightIdx, int leftConformance, int rightConformance)
Description copied from class:AbstractPendingLinkingCandidate
Compare this linking candidate with the givenother
candidate atleftIdx
andrightIdx
respectively. ReturnsCandidateCompareResult#THIS
if this candidate is better,CandidateCompareResult#OTHER
if the right candidate was better,CandidateCompareResult#AMBIGUOUS
if both candidates are valid but ambiguous orCandidateCompareResult#EQUALLY_INVALID
if both candidates are ambiguous but erroneous.- Overrides:
compareByArgumentTypesFlags
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Parameters:
right
- the other candidateleftIdx
- the semantic argument index on this candidaterightIdx
- the semantic argument index on the other candidateleftConformance
- the computed conformance in this linking candidaterightConformance
- the computed conformance if the other candidate was chosen
-
isFirstArgument
protected boolean isFirstArgument(int argumentIndex)
-
compareByArgumentTypes
protected CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right, int leftBoxing, int rightBoxing, int leftDemand, int rightDemand)
Description copied from class:AbstractPendingLinkingCandidate
Compare this linking candidate with the givenother
candidate atargumentIndex
ReturnsCandidateCompareResult#THIS
if this candidate is better,CandidateCompareResult#OTHER
if the right candidate was better,CandidateCompareResult#AMBIGUOUS
if both candidates are valid but ambiguous orCandidateCompareResult#EQUALLY_INVALID
if both candidates are ambiguous but erroneous.- Overrides:
compareByArgumentTypes
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Parameters:
right
- the other candidate (the rhs of the comparison)leftBoxing
- the number of required boxing conversions if this candidate was chosenrightBoxing
- the number of required boxing conversions if the other candidate was chosenleftDemand
- the number of required demand conversions if this candidate was chosenrightDemand
- the number of required demand conversions if the other candidate was chosen
-
compareByArgumentTypes
protected CandidateCompareResult compareByArgumentTypes(FeatureLinkingCandidate right, int leftBoxing, int rightBoxing)
-
compareByArgumentTypesAndStaticFlag
protected CandidateCompareResult compareByArgumentTypesAndStaticFlag(FeatureLinkingCandidate right, int leftBoxing, int rightBoxing)
-
preApply
protected void preApply()
- Overrides:
preApply
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
applyImplicitReceiver
protected void applyImplicitReceiver()
-
resolveAgainstActualType
protected void resolveAgainstActualType(LightweightTypeReference declaredType, LightweightTypeReference actualType, AbstractTypeComputationState state)
- Overrides:
resolveAgainstActualType
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getFeatureCall
public XAbstractFeatureCall getFeatureCall()
Description copied from interface:IFeatureLinkingCandidate
Returns the feature call that is linked.- Specified by:
getFeatureCall
in interfaceIFeatureLinkingCandidate
- Returns:
- the feature call.
-
getPlainSyntacticTypeArguments
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference> getPlainSyntacticTypeArguments()
- Specified by:
getPlainSyntacticTypeArguments
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
resolveArgumentType
protected void resolveArgumentType(XExpression argument, LightweightTypeReference declaredType, ITypeComputationState argumentState)
- Overrides:
resolveArgumentType
in 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)
-
computeVarArgumentType
protected void computeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)
- Overrides:
computeVarArgumentType
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaratorParameterMapping
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> getDeclaratorParameterMapping()
- Overrides:
getDeclaratorParameterMapping
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getReceiver
protected XExpression getReceiver()
-
getReceiverType
protected LightweightTypeReference getReceiverType()
-
getReceiverConformanceFlags
protected int getReceiverConformanceFlags()
-
getFirstArgument
protected XExpression getFirstArgument()
Returns the first argument if this is an extension. This may be the implicit first argument or the syntactic receiver of the feature call.
-
getFirstArgumentType
protected LightweightTypeReference getFirstArgumentType()
-
getImplicitReceiver
protected XExpression getImplicitReceiver()
-
getImplicitReceiverType
protected LightweightTypeReference getImplicitReceiverType()
-
getSyntacticReceiver
protected XExpression getSyntacticReceiver()
-
getSyntacticReceiverIfPossibleArgument
protected XExpression getSyntacticReceiverIfPossibleArgument()
Returns the syntactic receiver if it is an expression. Type literals are not considered to be expressions thusnull
is returned as the syntactic receiver of the expressionvalueOf(..)
injava.lang.String.valueOf(..)
.
-
getSyntacticReceiverType
protected LightweightTypeReference getSyntacticReceiverType()
-
getImplicitFirstArgument
protected XExpression getImplicitFirstArgument()
-
getImplicitFirstArgumentType
protected LightweightTypeReference getImplicitFirstArgumentType()
-
getDeclaredType
protected LightweightTypeReference getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
- Overrides:
getDeclaredType
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
isGetClassOnTypeLiteral
protected boolean isGetClassOnTypeLiteral()
Returnstrue
if the methodObject.getClass()
is bound and the receiver is a type literal. This may indicate a bug.
-
isGetClass
protected boolean isGetClass(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
-
applyToModel
public void applyToModel(IResolvedTypes resolvedTypes)
Description copied from interface:ILinkingCandidate
Injects the resolved feature into the model with the same semantics as the implicitresolve
of EMF. This implies that the linked feature call may still point to a proxy afterwards.- Specified by:
applyToModel
in interfaceIApplicableCandidate
- Specified by:
applyToModel
in interfaceILinkingCandidate
-
getUnhandledExceptionSeverity
protected org.eclipse.xtext.diagnostics.Severity getUnhandledExceptionSeverity(org.eclipse.xtext.common.types.JvmExecutable executable)
Description copied from class:AbstractPendingLinkingCandidate
Obtain the currently applicable severity for uncaught exceptions. Sneaky throw techniques cannot be applied to delegating constructor calls. Therefore it's possible to raise the severity for them by checking the linked executable.- Overrides:
getUnhandledExceptionSeverity
in classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
- Parameters:
executable
- the executable that declares the exception.
-
-