txt: ## self.md
  self
  
  Combined from primary sources listed below.
  
  # [In Terms](#___top "go to top of document")[§](#(Terms)_term_self "direct link")
  
  See primary documentation
  [in context](/language/terms#term_self)
  for **term self**.
  
  Inside a method, `self` refers to the invocant (i.e. the object the method was called on). If used in a context where it doesn't make sense, a compile-time exception of type [`X::Syntax::NoSelf`](/type/X/Syntax/NoSelf) is thrown.
  
  # [In Mu](#___top "go to top of document")[§](#(Mu)_method_self "direct link")
  
  See primary documentation
  [in context](/type/Mu#method_self)
  for **method self**.
  
  ```raku
  method self(--> Mu)
  ```
  
  Returns the object it is called on.
  
  # [In Failure](#___top "go to top of document")[§](#(Failure)_method_self "direct link")
  
  See primary documentation
  [in context](/type/Failure#method_self)
  for **method self**.
  
  ```raku
  method self(Failure:D: --> Failure:D)
  ```
  
  If the invocant is a [handled](/routine/handled) `Failure`, returns it as is. If not handled, throws its [`Exception`](/type/Exception). Since [`Mu`](/type/Mu) type [provides `.self`](/type/Mu#method_self) for every class, calling this method is a handy way to explosively filter out Failures:
  
  ```raku
  my $num1 = '♥'.Int;
  # $num1 now contains a Failure object, which may not be desirable
  
  my $num2 = '♥'.Int.self;
  # .self method call on Failure causes an exception to be thrown
  
  my $num3 = '42'.Int.self;
  # Int type has a .self method, so here $num3 has `42` in it
  
  (my $stuff = '♥'.Int).so;
  say $stuff.self; # OUTPUT: «(HANDLED) Cannot convert string to number…»
  # Here, Failure is handled, so .self just returns it as is
  ```
  