txt: ## mrobasedmethoddispatch.md
  role Metamodel::MROBasedMethodDispatch
  
  Metaobject that supports resolving inherited methods
  
  ```raku
  role Metamodel::MROBasedMethodDispatch { }
  ```
  
  *Warning*: this role is part of the Rakudo implementation, and is not a part of the language specification.
  
  This role implements locating methods based on the method resolution order of related (usually "super"/"parent") types.
  
  # [Methods](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#Methods "direct link")
  
  ## [method find\_method](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_find_method "direct link")
  
  ```raku
  method find_method($obj, $name, :$no_fallback, *%adverbs)
  ```
  
  Given a method name, it returns the method object of that name which is closest in the method resolution order (MRO). If no method can be found, it returns a VM-specific sentinel value (typically a low-level NULL value) that can be tested for with a test for [definedness](/routine/defined):
  
  ```raku
  for <uppercase  uc> {
      Str.^find_method: $^meth andthen .("foo").say
          orelse "method `$meth` not found".say
  }
  # OUTPUT:
  # method `uppercase` not found
  # FOO
  
  ```
  
  If `:no_fallback` is supplied, fallback methods are not considered.
  
  ## [method find\_method\_qualified](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_find_method_qualified "direct link")
  
  ```raku
  method find_method_qualified($obj, $type, $name)
  ```
  
  Given a method name and a type, returns the method from that type. This is used in calls like
  
  ```raku
  self.SomeParentClass::the_method();
  
  ```
  
  ## [method can](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_can "direct link")
  
  ```raku
  method can($obj, $name)
  ```
  
  Returns the list of methods of that name the object can do.
  
  ## [method publish\_method\_cache](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_publish_method_cache "direct link")
  
  ```raku
  method publish_method_cache($obj)
  ```
  
  Walk MRO and add methods to cache, unless another method lower in the class hierarchy "shadowed" it.
  