Class ResolvedTypes

    • Method Detail

      • getMonitor

        protected org.eclipse.xtext.util.CancelIndicator getMonitor()
        Since:
        2.7
      • checkCanceled

        protected void checkCanceled()
      • clear

        protected void clear()
      • getSeverities

        protected org.eclipse.xtext.validation.IssueSeverities getSeverities()
      • getContextResourceSet

        public org.eclipse.emf.ecore.resource.ResourceSet getContextResourceSet()
      • getQueuedDiagnostics

        public java.util.Collection<org.eclipse.xtext.diagnostics.AbstractDiagnostic> getQueuedDiagnostics()
        Description copied from interface: IResolvedTypes
        Provides access to all diagnostics that have been added during the type computation so far.
        Specified by:
        getQueuedDiagnostics in interface IResolvedTypes
      • getDeferredLogic

        public java.util.Collection<org.eclipse.xtext.util.IAcceptor<? super IResolvedTypes>> getDeferredLogic()
      • clearDeferredLogic

        protected void clearDeferredLogic()
      • addDiagnostic

        public void addDiagnostic​(org.eclipse.xtext.diagnostics.AbstractDiagnostic diagnostic)
      • addDeferredLogic

        protected void addDeferredLogic​(org.eclipse.xtext.util.IAcceptor<? super IResolvedTypes> code)
      • getLinkedFeature

        public org.eclipse.xtext.common.types.JvmIdentifiableElement getLinkedFeature​(XAbstractFeatureCall featureCall)
        Description copied from interface: IResolvedTypes
        Returns the intermediate linking result for the given feature call, if any. If the feature call is null, the result is null.
        Specified by:
        getLinkedFeature in interface IResolvedTypes
        Parameters:
        featureCall - the feature call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • getLinkedFeature

        public org.eclipse.xtext.common.types.JvmIdentifiableElement getLinkedFeature​(XConstructorCall constructorCall)
        Description copied from interface: IResolvedTypes
        Returns the intermediate linking result for the given constructor call, if any. If the constructor call is null, the result is null. If the constructor call is broken, it may return a JvmType instead of a JvmConstructor.
        Specified by:
        getLinkedFeature in interface IResolvedTypes
        Parameters:
        constructorCall - the constructor call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • getLinkingCandidate

        public IFeatureLinkingCandidate getLinkingCandidate​(XAbstractFeatureCall featureCall)
        Description copied from interface: IResolvedTypes
        Returns the intermediate linking candidate for the given feature call, if any. If the feature call is null, the result is null.
        Specified by:
        getLinkingCandidate in interface IResolvedTypes
        Parameters:
        featureCall - the feature call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • getLinkingCandidate

        public IConstructorLinkingCandidate getLinkingCandidate​(XConstructorCall constructorCall)
        Description copied from interface: IResolvedTypes
        Returns the intermediate linking candidate for the given constructor call, if any. If the constructor call is null, the result is null. If the constructor call is broken, it may return a JvmType instead of a JvmConstructor.
        Specified by:
        getLinkingCandidate in interface IResolvedTypes
        Parameters:
        constructorCall - the constructor call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • doGetLinkedFeature

        protected org.eclipse.xtext.common.types.JvmIdentifiableElement doGetLinkedFeature​(XExpression featureOrConstructorCall)
      • getTypeData

        protected TypeData getTypeData​(XExpression expression,
                                       boolean returnType)
      • getTypeData

        protected TypeData getTypeData​(XExpression expression,
                                       boolean returnType,
                                       boolean nullIfEmpty)
      • mergeTypeData

        protected TypeData mergeTypeData​(XExpression expression,
                                         java.util.List<TypeData> allValues,
                                         boolean returnType,
                                         boolean nullIfEmpty)
      • getExpectedTypeForAssociatedExpression

        protected abstract LightweightTypeReference getExpectedTypeForAssociatedExpression​(org.eclipse.xtext.common.types.JvmMember member,
                                                                                           XExpression expression)
      • getReturnType

        public LightweightTypeReference getReturnType​(XExpression expression,
                                                      boolean onlyExplicitReturns)
        Description copied from interface: IResolvedTypes
        Returns the actually inferred return type for the given expression or null if none.
        Specified by:
        getReturnType in interface IResolvedTypes
        Parameters:
        expression - expression whose return type is queried.
      • discardExpectedExceptions

        protected ResolvedTypes discardExpectedExceptions()
      • pushExpectedExceptions

        protected ResolvedTypes pushExpectedExceptions​(org.eclipse.xtext.common.types.JvmExecutable exceptionDeclarator)
      • isVoidTypeAllowed

        public boolean isVoidTypeAllowed​(XExpression expression)
        Description copied from interface: IResolvedTypes
        Returns true if the given expression may have the type void.
        Specified by:
        isVoidTypeAllowed in interface IResolvedTypes
        Parameters:
        expression - expression whose expected type is queried.
      • isVoidReturnTypeAllowed

        public boolean isVoidReturnTypeAllowed​(XExpression expression)
      • getActualTypeArguments

        public final java.util.List<LightweightTypeReference> getActualTypeArguments​(XExpression expression)
        Description copied from interface: IResolvedTypes
        Returns the resolved type arguments. If the expression refers to a constructor and the constructor itself defines type parameters, their resolved representation is prepended to the list of type arguments. Consider the following type:
         class C<T, V> {
           public <PLgt; C(P p) {}
         }
         
        An invocation of the constructor C will return three type arguments, the bound values of for P, T and V.
        Specified by:
        getActualTypeArguments in interface IResolvedTypes
        Parameters:
        expression - may either be an XAbstractFeatureCall or XConstructorCall. May not be null.
      • setType

        public void setType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable,
                            LightweightTypeReference reference)
      • reassignType

        public void reassignType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable,
                                 LightweightTypeReference reference)
      • isRefinedType

        protected boolean isRefinedType​(org.eclipse.xtext.common.types.JvmIdentifiableElement element)
      • reassignTypeWithoutMerge

        public void reassignTypeWithoutMerge​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable,
                                             LightweightTypeReference reference)
      • getConformanceFlags

        protected int getConformanceFlags​(TypeData typeData,
                                          boolean recompute)
      • basicGetTypes

        protected java.util.Map<org.eclipse.xtext.common.types.JvmIdentifiableElement,​LightweightTypeReference> basicGetTypes()
      • basicGetReassignedTypes

        protected java.util.Map<org.eclipse.xtext.common.types.JvmIdentifiableElement,​LightweightTypeReference> basicGetReassignedTypes()
      • basicGetExpressionTypes

        protected java.util.Map<XExpression,​java.util.List<TypeData>> basicGetExpressionTypes()
      • basicGetTypeParameterHints

        protected java.util.Map<java.lang.Object,​java.util.List<LightweightBoundTypeArgument>> basicGetTypeParameterHints()
      • getFollowUpErrors

        public java.util.Collection<ILinkingCandidate> getFollowUpErrors()
        Description copied from interface: IResolvedTypes
        Returns the linking candidates that could not be resolved but are not exposed to the users because they are follow up errors.
        Specified by:
        getFollowUpErrors in interface IResolvedTypes
      • getActualType

        public LightweightTypeReference getActualType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable)
        Description copied from interface: IResolvedTypes
        Returns the actually inferred or declared type for the given identifiable or null if none.
        Specified by:
        getActualType in interface IResolvedTypes
        Parameters:
        identifiable - identifiable whose type is queried.
      • doGetActualType

        protected final LightweightTypeReference doGetActualType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable,
                                                                 boolean ignoreReassignedTypes)
      • doGetActualTypeNoDeclaration

        protected LightweightTypeReference doGetActualTypeNoDeclaration​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable,
                                                                        boolean ignoreReassignedTypes)
      • doGetDeclaredType

        protected LightweightTypeReference doGetDeclaredType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable)
      • getDeclaredType

        protected org.eclipse.xtext.common.types.JvmTypeReference getDeclaredType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable)
      • getUnboundTypeReference

        protected UnboundTypeReference getUnboundTypeReference​(java.lang.Object handle)
      • createUnboundTypeReference

        protected UnboundTypeReference createUnboundTypeReference​(XExpression expression,
                                                                  org.eclipse.xtext.common.types.JvmTypeParameter type)
      • acceptUnboundTypeReference

        protected void acceptUnboundTypeReference​(java.lang.Object handle,
                                                  UnboundTypeReference reference)
      • basicGetTypeParameters

        protected java.util.Map<java.lang.Object,​UnboundTypeReference> basicGetTypeParameters()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • closeBracket

        protected void closeBracket​(java.lang.StringBuilder result,
                                    java.lang.String indentation)
      • appendContent

        protected void appendContent​(java.lang.StringBuilder result,
                                     java.lang.String indentation)
      • appendContent

        protected void appendContent​(java.util.Map<?,​?> map,
                                     java.lang.String prefix,
                                     java.lang.StringBuilder result,
                                     java.lang.String indentation)
      • appendContent

        protected void appendContent​(java.util.Collection<?> values,
                                     java.lang.String prefix,
                                     java.lang.StringBuilder result,
                                     java.lang.String indentation)
      • appendListMapContent

        protected void appendListMapContent​(java.util.Map<?,​? extends java.util.Collection<?>> map,
                                            java.lang.String prefix,
                                            java.lang.StringBuilder result,
                                            java.lang.String indentation)
      • resolveDependentTypeArguments

        protected void resolveDependentTypeArguments​(java.lang.Object handle,
                                                     LightweightBoundTypeArgument boundTypeArgument)
      • isResolved

        public final boolean isResolved​(java.lang.Object handle)
      • doIsResolved

        protected boolean doIsResolved​(java.lang.Object handle)
      • isPropagatedType

        protected boolean isPropagatedType​(XExpression expression)
      • isRefinedType

        public boolean isRefinedType​(XExpression expression)
        Description copied from interface: IResolvedTypes
        Returns true if the expression's type is based on a type refinement, e.g. an instanceof guard my specialize the type of the checked reference. Any feature call to that reference is considered to be based on a refined type.
        Specified by:
        isRefinedType in interface IResolvedTypes
        Parameters:
        expression - the expression that may have been typed based on a refinement.
        Returns:
        true if the type was refined, false otherwise.
      • setPropagatedType

        protected void setPropagatedType​(XExpression expression)
      • setRefinedType

        protected void setRefinedType​(XExpression expression)
      • basicGetPropagatedTypes

        protected java.util.Set<XExpression> basicGetPropagatedTypes()
      • basicGetRefinedTypes

        protected java.util.Set<XExpression> basicGetRefinedTypes()
      • basicGetDeclaredTypeParameters

        protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> basicGetDeclaredTypeParameters()
      • basicGetDeclardTypeParameters

        @Deprecated(forRemoval=true)
        protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> basicGetDeclardTypeParameters()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getDeclaredTypeParameters

        public java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getDeclaredTypeParameters()
      • addDeclaredTypeParameters

        public void addDeclaredTypeParameters​(java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> typeParameters)
      • markToBeInferred

        protected abstract void markToBeInferred​(XExpression expression)
      • getExpressionScope

        public IExpressionScope getExpressionScope​(org.eclipse.emf.ecore.EObject context,
                                                   IExpressionScope.Anchor anchor)
        Description copied from interface: IResolvedTypes
        Returns the scope the given expression is contained in. This considers all decision paths that were taken while computing the type of the expression. The returned scope carries some meta data such as whether there was an attempt to resolve the given expression as a type.
        Specified by:
        getExpressionScope in interface IResolvedTypes
      • withFlattenedReassignedTypes

        protected IResolvedTypes withFlattenedReassignedTypes()
      • getFlattenedReassignedTypes

        protected java.util.Map<org.eclipse.xtext.common.types.JvmIdentifiableElement,​LightweightTypeReference> getFlattenedReassignedTypes()