Class ResolvedOperationInHierarchy

    • Constructor Detail

      • ResolvedOperationInHierarchy

        protected ResolvedOperationInHierarchy​(org.eclipse.xtext.common.types.JvmOperation declaration,
                                               BottomResolvedOperation bottom)
    • Method Detail

      • getResolvedTypeParameters

        public java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getResolvedTypeParameters()
        Description copied from interface: IResolvedOperation
        Returns the resolved type parameters for a given operation. If this operation represents an overridden operation, the type parameters are the ones that are declared on the initially requested resolved operation. Consider the following interface and implementation class:
         interface I {
           <T extends CharSequence> T method()
         }
         class C implements I {
           public <V extends CharSequence> V method() {
             return null;
           }
         }
         
        If the initially requested method was C#method and the current handle points to I#method, the type parameters will contain V instead of T. The list may contain a different number of type parameters than the actual operation.
         interface I {
           <T> T method()
         }
         class C implements I {
           public String method() {
             return null;
           }
         }
         
        The method I#method in the context of class C will yield an empty list of resolved type parameters even though it declares T.
        Specified by:
        getResolvedTypeParameters in interface IResolvedOperation
        Overrides:
        getResolvedTypeParameters in class AbstractResolvedOperation
        Returns:
        the list of resolved type parameters.
      • isBottomInContext

        public boolean isBottomInContext()
        Description copied from interface: IResolvedOperation
        Returns true if the bottom of this resolved method hierachy, which that there is no specialization of this method in the current context.
         interface I1 {
           void m()
         }
         interface I2 {
           void m()
         }
         abstract class C implements I1, I2 {
         }
         
        If you get hold on the abstract method I1#m or I2#m both will return true.
        See Also:
        IResolvedOperation.getAsBottom()
      • getAsBottom

        public IResolvedOperation getAsBottom()
        Description copied from interface: IResolvedOperation
        Returns the current method as a bottom method. That implies, that the context type of the result is the resolved declarator of the current declaration.
         interface I<T> {
           <K> T m(K k);
         }
         class C implements I<V< {
           <U> V m(U u);
         }
         
        If this resolved method represents I#m in the context of class C (thus the return type will be V and the resolved type parameters include U, IResolvedOperation.getAsBottom() will yield I#m in the context of I<V<. That is, the return type is still resolved to V. Nevertheless, the local type parameter of I#m is now resolved to its declaration K. This implies that the parameter type is no longer resolved to U but K instead. The bottom representation can be used to create descriptive error messages. If the current resolved method is already a bottom type, it is returned itself.
        Returns:
        the current operation as bottom type.
        See Also:
        IResolvedOperation.isBottomInContext()
      • getOverrideCheckResult

        public IOverrideCheckResult getOverrideCheckResult()
        Description copied from interface: IResolvedOperation
        The override check result that is associated with this operation. If this is a bottom, the details will only include the current detail. In other cases, the actual information about the relationship of the hierarchy function to its specialization in the context is returned.
        Returns:
        the computed check result