Interface IResolvedTypes

    • Method Detail

      • getQueuedDiagnostics

        java.util.Collection<org.eclipse.xtext.diagnostics.AbstractDiagnostic> getQueuedDiagnostics()
        Provides access to all diagnostics that have been added during the type computation so far.
      • getFollowUpErrors

        java.util.Collection<ILinkingCandidate> getFollowUpErrors()
        Returns the linking candidates that could not be resolved but are not exposed to the users because they are follow up errors.
      • getAmbiguousLinkingCandidates

        java.util.Collection<IAmbiguousLinkingCandidate> getAmbiguousLinkingCandidates()
        Returns all ambiguous linking candidates that have been encountered.
      • getActualType

        LightweightTypeReference getActualType​(XExpression expression)
        Returns the actually inferred type for the given expression or null if none.
        Parameters:
        expression - expression whose type is queried.
      • getReturnType

        LightweightTypeReference getReturnType​(XExpression expression)
        Returns the actually inferred return type for the given expression or null if none. Returns the actual expression type, if no explicit return type exists. Shorthand for getReturnType(expression, false)
        Parameters:
        expression - expression whose return type is queried.
      • getReturnType

        LightweightTypeReference getReturnType​(XExpression expression,
                                               boolean onlyExplicitReturns)
        Returns the actually inferred return type for the given expression or null if none.
        Parameters:
        expression - expression whose return type is queried.
      • getActualType

        LightweightTypeReference getActualType​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable)
        Returns the actually inferred or declared type for the given identifiable or null if none.
        Parameters:
        identifiable - identifiable whose type is queried.
      • getExpectedType

        LightweightTypeReference getExpectedType​(XExpression expression)
        Returns the actually expected type for the given expression or null if none.
        Parameters:
        expression - expression whose expected type is queried.
      • isVoidTypeAllowed

        boolean isVoidTypeAllowed​(XExpression expression)
        Returns true if the given expression may have the type void.
        Parameters:
        expression - expression whose expected type is queried.
      • getExpectedReturnType

        LightweightTypeReference getExpectedReturnType​(XExpression expression)
        Returns the expected return type for the given expression or null if none.
        Parameters:
        expression - expression whose expected return type is queried.
      • getActualTypeArguments

        java.util.List<LightweightTypeReference> getActualTypeArguments​(XExpression expression)
        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.
        Parameters:
        expression - may either be an XAbstractFeatureCall or XConstructorCall. May not be null.
      • getLinkedFeature

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

        org.eclipse.xtext.common.types.JvmIdentifiableElement getLinkedFeature​(XConstructorCall constructorCall)
        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.
        Parameters:
        constructorCall - the constructor call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • getLinkingCandidate

        IFeatureLinkingCandidate getLinkingCandidate​(XAbstractFeatureCall featureCall)
        Returns the intermediate linking candidate for the given feature call, if any. If the feature call is null, the result is null.
        Parameters:
        featureCall - the feature call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • getLinkingCandidate

        IConstructorLinkingCandidate getLinkingCandidate​(XConstructorCall constructorCall)
        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.
        Parameters:
        constructorCall - the constructor call that is queried for the current linking state.
        Returns:
        the potentially intermediate linking state or null if none.
      • isRefinedType

        boolean isRefinedType​(XExpression expression)
        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.
        Parameters:
        expression - the expression that may have been typed based on a refinement.
        Returns:
        true if the type was refined, false otherwise.
      • getExpressionScope

        IExpressionScope getExpressionScope​(org.eclipse.emf.ecore.EObject context,
                                            IExpressionScope.Anchor anchor)
        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.
      • hasExpressionScope

        boolean hasExpressionScope​(org.eclipse.emf.ecore.EObject context,
                                   IExpressionScope.Anchor anchor)