Module xl.compiler

Interface Members.Resolution

All Known Implementing Classes:
Compiler, CompilerBase
Enclosing class:
Members

public static interface Members.Resolution
Resolution defines a strategy how applicable members for explicitly given arguments are determined and how the most specific member of these is chosen.
Author:
Ole Kniemeyer
  • Method Details

    • allowsAmbiguousMembers

      boolean allowsAmbiguousMembers(Member first)
      Defines if ambiguous members are allowed. If so, ambiguities between members do not cause an exception be thrown in Members#find(Resolution); the first member is returned.
      Parameters:
      first - the first member of a set of ambiguous members
      Returns:
      true iff ambiguous members are allowed and first shall be returned as the result of resolution
    • isApplicable

      boolean isApplicable(Member m, Members.Applicability applOut, Scope scope)
      Checks whether a member m is applicable. The quality of applicability is stored in applOut by this method.
      Parameters:
      m - a member
      applOut - the quality of applicability is stored here by this method
      scope - scope in which the member is accessed
      Returns:
      true iff m is applicable
    • getArgumentTypes

      Type[] getArgumentTypes()
      Returns the argument types which are used in isApplicable(Member, Members.Applicability, Scope) to determine the applicability. This method is only invoked to generate an error message in case no applicable member was found.
      Returns:
      argument types
    • isLessThan

      boolean isLessThan(Member m1, Members.Applicability a1, Member m2, Members.Applicability a2, Scope scope)
      Checks whether an applicable member m1 is less specific than another applicable member m2. The applicablities are the same instances which have been passed before to isApplicable(Member, Members.Applicability, Scope).
      Parameters:
      m1 - a member
      a1 - m1's applicability as determined by isApplicable(Member, Members.Applicability, Scope)
      m2 - another member
      a2 - m2's applicability as determined by isApplicable(Member, Members.Applicability, Scope)
      scope - scope in which the member is accessed
      Returns:
      true iff m1 is less specific than m2