Class TypeLiteralLinkingCandidate
- 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.TypeLiteralLinkingCandidate
-
- All Implemented Interfaces:
IApplicableCandidate,IFeatureLinkingCandidate,ILinkingCandidate,ITypeLiteralLinkingCandidate
public class TypeLiteralLinkingCandidate extends AbstractPendingLinkingCandidate<XAbstractFeatureCall> implements ITypeLiteralLinkingCandidate
-
-
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
-
-
Constructor Summary
Constructors Constructor Description TypeLiteralLinkingCandidate(XAbstractFeatureCall featureCall, IIdentifiableElementDescription description, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyToModel(IResolvedTypes resolvedTypes)Injects the resolved feature into the model with the same semantics as the implicitresolveof EMF.voidcomputeArgumentTypes()protected ILinkingCandidatecreateAmbiguousLinkingCandidate(AbstractPendingLinkingCandidate<?> second)Produce a candidate that carries the information about ambiguous candidates.protected java.util.List<XExpression>getArguments()Returns the actual arguments of the expression.intgetArityMismatch()Returns the mismatch of actually given arguments and declared parameters.protected intgetConformanceFlags(int idx, boolean recompute)protected LightweightTypeReferencegetDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter>getDeclaredTypeParameters()XAbstractFeatureCallgetFeatureCall()Returns the feature call that is linked.protected java.lang.StringgetFeatureTypeName()Returns the name of the feature type, e.g.protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference>getPlainSyntacticTypeArguments()protected LightweightTypeReferencegetSubstitutedExpectedType(int argumentIndex)Returns the substituted expected type for the argument atargumentIndex.protected java.util.List<XExpression>getSyntacticArguments()org.eclipse.xtext.common.types.JvmTypegetType()Returns the type that shall be resolved as a literal.protected intgetTypeArgumentConformanceFailures(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> acceptor)java.util.List<LightweightTypeReference>getTypeArguments()The resolved type arguments.intgetTypeArityMismatch()protected booleanhasReceiver()Returnstrueif the argument at index 0 will be considered as the receiver.booleanisExtension()Returnstrueif the linked feature is contributed by an extension.booleanisStatic()Returnstrueif the linked feature is static.booleanisTypeLiteral()Returnstrueif the feature call is linked as a type literal.protected voidpreApply()protected booleanvalidateTypeArity(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractPendingLinkingCandidate
compareByArgumentTypes, compareByArgumentTypes, compareByArgumentTypes, compareByArgumentTypesFlags, compareByArity, compareByArityWith, compareByBoxing, compareByBucket, compareByName, compareByTypeArguments, compareDeclaredTypes, compareExpectedArgumentTypes, compareTo, compareTo, createSuspiciousLinkingCandidate, getAllDescriptionsHash, getArgumentTypesAsString, getArityMismatch, getDefaultValidationFeature, getExpectedTypeCompareResultOther, getFeature, getFeatureParameterTypesAsString, getFeatureParameterTypesAsString, getFeatureTypeParametersAsString, getInvalidArgumentsValidationFeature, getPreferredCandidate, getSeverity, getSimpleFeatureName, getTypeArgumentsAsString, getTypeParameterAsString, getTypeParameterMapping, getUnhandledExceptionSeverity, isDefiniteEarlyExit, isLambdaExpression, isPossibleFunctionType, isVarArgs, isVisible, resolveLinkingProxy, setAllDescriptionsHash, toString, validate, validateArity, validateTypeArgumentConformance, validateUnhandledExceptions, validateUnhandledExceptions, validateVisibility
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
accept, applyToComputationState, computeArgumentType, computeFixedArityArgumentType, computeVarArgumentType, createArgumentTypeSubstitutor, createLinkingTypeComputationState, createVarArgTypeComputationState, deferredBindTypeArgument, discardRefinementTypeIfReassigned, getActualType, getActualType, getDeclaratorParameterMapping, getExpectedType, getExpression, getState, getSyntacticTypeArguments, initializeArgumentTypeComputation, initializeConstraintMapping, initializeMapping, initializeTypeParameterMapping, initializeTypeParameterMapping, isBoundTypeArgumentSkipped, isRawTypeContext, mustDiscardRefinement, resolveAgainstActualType, resolveArgumentType
-
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
applyToComputationState, getExpression, getFeature, getPreferredCandidate
-
-
-
-
Constructor Detail
-
TypeLiteralLinkingCandidate
public TypeLiteralLinkingCandidate(XAbstractFeatureCall featureCall, IIdentifiableElementDescription description, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
-
Method Detail
-
computeArgumentTypes
public void computeArgumentTypes()
- Overrides:
computeArgumentTypesin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
createAmbiguousLinkingCandidate
protected ILinkingCandidate createAmbiguousLinkingCandidate(AbstractPendingLinkingCandidate<?> second)
Description copied from class:AbstractPendingLinkingCandidateProduce a candidate that carries the information about ambiguous candidates.- Specified by:
createAmbiguousLinkingCandidatein classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getArguments
protected java.util.List<XExpression> getArguments()
Returns the actual arguments of the expression. These do not include the receiver.- Specified by:
getArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getFeatureTypeName
protected java.lang.String getFeatureTypeName()
Description copied from class:AbstractPendingLinkingCandidateReturns the name of the feature type, e.g. a feature of typeJvmOperationmay returnmethod, aXVariableDeclarationmay identify itself aslocal variable.- Specified by:
getFeatureTypeNamein classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getArityMismatch
public int getArityMismatch()
Description copied from class:AbstractPendingLinkingCandidateReturns the mismatch of actually given arguments and declared parameters. Receivers and staticness of the feature is taken into account, too. The mismatch may either be negative or positive.- Overrides:
getArityMismatchin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getSyntacticArguments
protected java.util.List<XExpression> getSyntacticArguments()
- Overrides:
getSyntacticArgumentsin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is contributed by an extension.- Specified by:
isExtensionin interfaceIFeatureLinkingCandidate- Specified by:
isExtensionin interfaceITypeLiteralLinkingCandidate- Overrides:
isExtensionin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>- Returns:
- always
false.
-
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- Specified by:
isStaticin interfaceITypeLiteralLinkingCandidate- Returns:
- always
false.
-
isTypeLiteral
public boolean isTypeLiteral()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the feature call is linked as a type literal.- Specified by:
isTypeLiteralin interfaceIFeatureLinkingCandidate- Specified by:
isTypeLiteralin interfaceITypeLiteralLinkingCandidate- Overrides:
isTypeLiteralin classAbstractLinkingCandidate<XAbstractFeatureCall>- Returns:
- always
true.
-
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>
-
getConformanceFlags
protected int getConformanceFlags(int idx, boolean recompute)- Overrides:
getConformanceFlagsin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getSubstitutedExpectedType
protected LightweightTypeReference getSubstitutedExpectedType(int argumentIndex)
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>
-
validateTypeArity
protected boolean validateTypeArity(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
- Overrides:
validateTypeArityin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredType
protected LightweightTypeReference getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
- Overrides:
getDeclaredTypein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredTypeParameters
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getDeclaredTypeParameters()
- Overrides:
getDeclaredTypeParametersin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getTypeArityMismatch
public int getTypeArityMismatch()
- Overrides:
getTypeArityMismatchin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getTypeArgumentConformanceFailures
protected int getTypeArgumentConformanceFailures(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> acceptor)
- Overrides:
getTypeArgumentConformanceFailuresin classAbstractPendingLinkingCandidate<XAbstractFeatureCall>
-
getTypeArguments
public java.util.List<LightweightTypeReference> getTypeArguments()
Description copied from interface:ILinkingCandidateThe resolved type arguments.- Specified by:
getTypeArgumentsin interfaceILinkingCandidate- Specified by:
getTypeArgumentsin interfaceITypeLiteralLinkingCandidate- Overrides:
getTypeArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>- Returns:
- an empty list.
-
preApply
protected void preApply()
- Overrides:
preApplyin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getType
public org.eclipse.xtext.common.types.JvmType getType()
Description copied from interface:ITypeLiteralLinkingCandidateReturns the type that shall be resolved as a literal.- Specified by:
getTypein interfaceITypeLiteralLinkingCandidate- Returns:
- the type.
-
applyToModel
public void applyToModel(IResolvedTypes resolvedTypes)
Description copied from interface:ILinkingCandidateInjects the resolved feature into the model with the same semantics as the implicitresolveof EMF. This implies that the linked feature call may still point to a proxy afterwards.- Specified by:
applyToModelin interfaceIApplicableCandidate- Specified by:
applyToModelin interfaceILinkingCandidate
-
-