@NonNullByDefault public abstract class AbstractPendingLinkingCandidate<Expression extends XExpression> extends AbstractLinkingCandidate<Expression>
AbstractLinkingCandidate.ArgumentTypeComputationState, AbstractLinkingCandidate.ObservableTypeExpectation
Modifier and Type | Field and Description |
---|---|
protected IIdentifiableElementDescription |
description
The backing feature descriptions.
|
arguments, typeArguments
Modifier | Constructor and Description |
---|---|
protected |
AbstractPendingLinkingCandidate(Expression expression,
IIdentifiableElementDescription description,
ITypeExpectation expectation,
ExpressionTypeComputationState state) |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right,
boolean recompute) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other,
int argumentIndex,
java.util.EnumSet<ConformanceHint> leftConformance,
java.util.EnumSet<ConformanceHint> rightConformance)
Compare this linking candidate with the given
other candidate at argumentIndex
Returns CandidateCompareResult#THIS if this candidate is better, CandidateCompareResult#OTHER if the
right candidate was better, CandidateCompareResult#AMBIGUOUS if both candidates are valid
but ambiguous or CandidateCompareResult#EQUALLY_INVALID if both candidates are
ambiguous but erroneous. |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other,
int leftBoxing,
int rightBoxing,
int leftDemand,
int rightDemand)
Compare this linking candidate with the given
other candidate at argumentIndex
Returns CandidateCompareResult#THIS if this candidate is better, CandidateCompareResult#OTHER if the
right candidate was better, CandidateCompareResult#AMBIGUOUS if both candidates are valid
but ambiguous or CandidateCompareResult#EQUALLY_INVALID if both candidates are
ambiguous but erroneous. |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByArity(int leftArityMismatch,
int rightArityMismatch) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByArityWith(AbstractPendingLinkingCandidate<?> right) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByBucket(AbstractPendingLinkingCandidate<?> right) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareByTypeArguments(AbstractPendingLinkingCandidate<?> right) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareExpectedArgumentTypes(AbstractPendingLinkingCandidate<?> right) |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareTo(AbstractPendingLinkingCandidate<?> right)
Returns
CandidateCompareResult#THIS if this candidate is better, CandidateCompareResult#OTHER if the
right candidate was better, CandidateCompareResult#AMBIGUOUS if both candidates are valid
but ambiguous or CandidateCompareResult#EQUALLY_INVALID if both candidates are
ambiguous but erroneous. |
protected abstract ILinkingCandidate |
createAmbiguousLinkingCandidate(AbstractPendingLinkingCandidate<?> second)
Produce a candidate that carries the information about ambiguous candidates.
|
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.lang.String |
getArgumentTypesAsString()
Returns the resolved string representation of the argument types.
|
int |
getArityMismatch()
Returns the mismatch of actually given arguments and declared parameters.
|
protected int |
getArityMismatch(JvmExecutable executable,
java.util.List<XExpression> arguments) |
protected java.util.EnumSet<ConformanceHint> |
getConformanceHints(int idx,
boolean recompute) |
protected org.eclipse.emf.ecore.EReference |
getDefaultValidationFeature() |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
getExpectedTypeCompareResultOther(AbstractPendingLinkingCandidate<?> other)
Returns the compare result for the declared parameter types if the given other candidate had won.
|
JvmIdentifiableElement |
getFeature()
The currently considered feature (if any).
|
protected java.lang.String |
getFeatureParameterTypesAsString()
Returns the unresolved string representation of the parameter types of the feature.
|
protected abstract java.lang.String |
getFeatureTypeName()
Returns the name of the feature type, e.g. a feature of type
JvmOperation may
return method , a XVariableDeclaration may identify itself as local variable . |
protected java.lang.String |
getFeatureTypeParametersAsString(boolean showBounds)
Returns the unresolved string representation of the unresolved type parameters of the feature.
|
protected org.eclipse.emf.ecore.EReference |
getInvalidArgumentsValidationFeature() |
ILinkingCandidate |
getPreferredCandidate(ILinkingCandidate other)
Returns the best candidate considering the this and the given other candidate.
|
protected java.util.List<XExpression> |
getSyntacticArguments() |
protected int |
getTypeArgumentConformanceFailures(IAcceptor<? super AbstractDiagnostic> acceptor) |
protected java.lang.String |
getTypeArgumentsAsString(java.util.List<? extends LightweightTypeReference> typeArguments)
Returns the resolved string representation of the type arguments.
|
int |
getTypeArityMismatch() |
protected java.lang.String |
getTypeParameterAsString(JvmTypeParameter typeParameter)
Returns the unresolved string representation of the given type parameter.
|
protected java.util.Map<JvmTypeParameter,LightweightMergedBoundTypeArgument> |
getTypeParameterMapping()
Returns the mapping of type parameters to their bound arguments.
|
protected void |
internalSetValue(org.eclipse.emf.ecore.InternalEObject featureCall,
org.eclipse.emf.ecore.EReference structuralFeature,
JvmIdentifiableElement newValue) |
protected boolean |
isDefiniteEarlyExit(XExpression expression) |
protected boolean |
isExtension() |
protected boolean |
isVarArgs() |
protected boolean |
isVisible() |
protected void |
resolveLinkingProxy(org.eclipse.emf.ecore.EReference structuralFeature,
int featureId) |
protected void |
resolveLinkingProxy(org.eclipse.emf.ecore.InternalEObject owner,
JvmIdentifiableElement newValue,
org.eclipse.emf.ecore.EReference structuralFeature,
int featureId) |
java.lang.String |
toString() |
boolean |
validate(IAcceptor<? super AbstractDiagnostic> result)
Validates this linking candidate and adds respective diagnostics to the given queue.
|
protected boolean |
validateArity(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateTypeArgumentConformance(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateTypeArity(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateUnhandledExceptions(IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateUnhandledExceptions(JvmExecutable executable,
IAcceptor<? super AbstractDiagnostic> result) |
protected boolean |
validateVisibility(IAcceptor<? super AbstractDiagnostic> result) |
accept, applyToComputationState, computeArgumentType, computeArgumentTypes, computeFixedArityArgumentType, computeVarArgumentType, createArgumentTypeSubstitutor, createLinkingTypeComputationState, createVarArgTypeComputationState, deferredBindTypeArgument, getActualType, getActualType, getArguments, getDeclaratorParameterMapping, getDeclaredType, getDeclaredTypeParameters, getExpectedType, getExpression, getState, getSubstitutedExpectedType, getSyntacticTypeArguments, getTypeArguments, hasReceiver, initializeArgumentTypeComputation, initializeConstraintMapping, initializeMapping, initializeTypeParameterMapping, initializeTypeParameterMapping, isBoundTypeArgumentSkipped, isRawTypeContext, isTypeLiteral, preApply, resolveAgainstActualType, resolveArgumentType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
applyToModel
protected final IIdentifiableElementDescription description
protected AbstractPendingLinkingCandidate(Expression expression, IIdentifiableElementDescription description, ITypeExpectation expectation, ExpressionTypeComputationState state)
protected java.util.Map<JvmTypeParameter,LightweightMergedBoundTypeArgument> getTypeParameterMapping()
getTypeParameterMapping
in class AbstractLinkingCandidate<Expression extends XExpression>
AbstractLinkingCandidate.initializeTypeParameterMapping()
protected abstract java.lang.String getFeatureTypeName()
JvmOperation
may
return method
, a XVariableDeclaration
may identify itself as local variable
.protected java.lang.String getArgumentTypesAsString()
protected java.lang.String getFeatureParameterTypesAsString()
protected java.lang.String getFeatureTypeParametersAsString(boolean showBounds)
protected java.lang.String getTypeParameterAsString(JvmTypeParameter typeParameter)
Object
.protected java.lang.String getTypeArgumentsAsString(java.util.List<? extends LightweightTypeReference> typeArguments)
public boolean validate(IAcceptor<? super AbstractDiagnostic> result)
true
if further validation should be performed.protected boolean validateVisibility(IAcceptor<? super AbstractDiagnostic> result)
protected org.eclipse.emf.ecore.EReference getDefaultValidationFeature()
@Nullable protected org.eclipse.emf.ecore.EReference getInvalidArgumentsValidationFeature()
protected boolean validateArity(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateTypeArity(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateTypeArgumentConformance(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateUnhandledExceptions(IAcceptor<? super AbstractDiagnostic> result)
protected boolean validateUnhandledExceptions(JvmExecutable executable, IAcceptor<? super AbstractDiagnostic> result)
protected boolean isDefiniteEarlyExit(XExpression expression)
protected java.util.List<XExpression> getSyntacticArguments()
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
protected abstract ILinkingCandidate createAmbiguousLinkingCandidate(AbstractPendingLinkingCandidate<?> second)
protected ILinkingCandidate createSuspiciousLinkingCandidate(AbstractPendingLinkingCandidate<?> chosenCandidate)
chosenCandidate
- the candidate that was picked.protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareTo(AbstractPendingLinkingCandidate<?> right)
CandidateCompareResult#THIS
if this candidate is better, CandidateCompareResult#OTHER
if the
right candidate was better, CandidateCompareResult#AMBIGUOUS
if both candidates are valid
but ambiguous or CandidateCompareResult#EQUALLY_INVALID
if both candidates are
ambiguous but erroneous.protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByBucket(AbstractPendingLinkingCandidate<?> right)
protected boolean isVisible()
protected boolean isVarArgs()
protected boolean isExtension()
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right)
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByTypeArguments(AbstractPendingLinkingCandidate<?> right)
protected int getTypeArgumentConformanceFailures(@Nullable IAcceptor<? super AbstractDiagnostic> acceptor)
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> right, boolean recompute)
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other, int argumentIndex, java.util.EnumSet<ConformanceHint> leftConformance, java.util.EnumSet<ConformanceHint> rightConformance)
other
candidate at argumentIndex
Returns CandidateCompareResult#THIS
if this candidate is better, CandidateCompareResult#OTHER
if the
right candidate was better, CandidateCompareResult#AMBIGUOUS
if both candidates are valid
but ambiguous or CandidateCompareResult#EQUALLY_INVALID
if both candidates are
ambiguous but erroneous.other
- the other candidateargumentIndex
- the semantic argument indexleftConformance
- the computed conformance in this linking candidaterightConformance
- the computed conformance if the other candidate was chosenprotected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other, int leftBoxing, int rightBoxing, int leftDemand, int rightDemand)
other
candidate at argumentIndex
Returns CandidateCompareResult#THIS
if this candidate is better, CandidateCompareResult#OTHER
if the
right candidate was better, CandidateCompareResult#AMBIGUOUS
if both candidates are valid
but ambiguous or CandidateCompareResult#EQUALLY_INVALID
if both candidates are
ambiguous but erroneous.other
- 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 chosenprotected java.util.EnumSet<ConformanceHint> getConformanceHints(int idx, boolean recompute)
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareExpectedArgumentTypes(AbstractPendingLinkingCandidate<?> right)
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult getExpectedTypeCompareResultOther(AbstractPendingLinkingCandidate<?> other)
other
- the winner of the comparison.protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByArityWith(AbstractPendingLinkingCandidate<?> right)
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareByArity(int leftArityMismatch, int rightArityMismatch)
public int getArityMismatch()
public int getTypeArityMismatch()
protected void resolveLinkingProxy(org.eclipse.emf.ecore.EReference structuralFeature, int featureId)
protected void resolveLinkingProxy(org.eclipse.emf.ecore.InternalEObject owner, JvmIdentifiableElement newValue, org.eclipse.emf.ecore.EReference structuralFeature, int featureId)
protected void internalSetValue(org.eclipse.emf.ecore.InternalEObject featureCall, org.eclipse.emf.ecore.EReference structuralFeature, JvmIdentifiableElement newValue)
protected int getArityMismatch(JvmExecutable executable, java.util.List<XExpression> arguments)
public JvmIdentifiableElement getFeature()
ILinkingCandidate
null
.getFeature
in interface ILinkingCandidate
getFeature
in class AbstractLinkingCandidate<Expression extends XExpression>
public java.lang.String toString()
toString
in class java.lang.Object