org.eclipse.xtext.xbase.typesystem.internal
Class AbstractLinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
java.lang.Object
org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate<LinkingCandidate>
- All Implemented Interfaces:
- java.lang.Comparable<LinkingCandidate>, ILinkingCandidate<LinkingCandidate>
- Direct Known Subclasses:
- AbstractLinkingCandidateWithTypeParameter
public abstract class AbstractLinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
- extends java.lang.Object
- implements ILinkingCandidate<LinkingCandidate>
- Author:
- Sebastian Zarnekow - Initial contribution and API
TODO Javadoc
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractLinkingCandidate
protected AbstractLinkingCandidate(XExpression expression,
IEObjectDescription description,
AbstractTypeComputationState state)
getDeclaredParameters
public java.util.List<JvmFormalParameter> getDeclaredParameters()
- Specified by:
getDeclaredParameters
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
getDeclaredTypeParameters
public java.util.List<JvmTypeParameter> getDeclaredTypeParameters()
- Specified by:
getDeclaredTypeParameters
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
apply
public void apply()
- Specified by:
apply
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
acceptActualType
protected void acceptActualType(ITypeExpectation expectation,
JvmTypeReference featureType)
asWrapperType
protected JvmTypeReference asWrapperType(JvmTypeReference potentialPrimitive)
getTypeParameter
protected JvmTypeParameter getTypeParameter(JvmTypeReference referenceToTypeParameter)
deferredBindTypeArguments
protected void deferredBindTypeArguments(ITypeExpectation expectation,
JvmTypeReference type)
getDeclaredType
protected JvmTypeReference getDeclaredType(JvmIdentifiableElement feature)
getDeclaratorParameterMapping
protected java.util.Map<JvmTypeParameter,JvmTypeReference> getDeclaratorParameterMapping()
computeArgumentTypes
protected void computeArgumentTypes(JvmIdentifiableElement feature,
JvmTypeReference featureType)
resolveArgumentType
protected StackedResolvedTypes resolveArgumentType(XExpression argument,
JvmTypeReference declaredType,
AbstractTypeComputationState argumentState)
getArguments
public java.util.List<XExpression> getArguments()
- Specified by:
getArguments
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
compareTo
public int compareTo(LinkingCandidate right)
- Specified by:
compareTo
in interface java.lang.Comparable<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
compareByArityWith
protected int compareByArityWith(LinkingCandidate right)
compareByArity
protected int compareByArity(int leftArityMismatch,
int rightArityMismatch)
getArityMismatch
public int getArityMismatch()
- Description copied from interface:
ILinkingCandidate
- two cases
- vararsgs: number of arguments is greater/equals to number of declared parameters
- default: number of arguments is equal to number of declared parameters
- Specified by:
getArityMismatch
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
getTypeArityMismatch
public int getTypeArityMismatch()
- Description copied from interface:
ILinkingCandidate
- two cases
- explicit type arguments: number of arguments is greater/equals to number of declared parameters
- else: 0
- Specified by:
getTypeArityMismatch
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
getTypeArguments
protected abstract java.util.List<JvmTypeReference> getTypeArguments()
getArityMismatch
protected int getArityMismatch(JvmExecutable executable,
java.util.List<XExpression> arguments)
getSyntacticArguments
protected abstract java.util.List<XExpression> getSyntacticArguments()
getDescription
protected IEObjectDescription getDescription()
getFeature
public JvmIdentifiableElement getFeature()
- Specified by:
getFeature
in interface ILinkingCandidate<LinkingCandidate extends ILinkingCandidate<LinkingCandidate>>
getReceiver
protected XExpression getReceiver()
getExpression
protected XExpression getExpression()
getState
protected AbstractTypeComputationState getState()