txt: ## line.md
  line
  
  Combined from primary sources listed below.
  
  # [In Backtrace::Frame](#___top "go to top of document")[§](#(Backtrace::Frame)_method_line "direct link")
  
  See primary documentation
  [in context](/type/Backtrace/Frame#method_line)
  for **method line**.
  
  ```raku
  method line(Backtrace::Frame:D --> Int)
  ```
  
  Returns the line number (line numbers start counting from 1).
  
  ```raku
  my $bt = Backtrace.new;
  my $btf = $bt[0];
  say $btf.line;
  ```
  
  # [In role X::Comp](#___top "go to top of document")[§](#(role_X::Comp)_method_line "direct link")
  
  See primary documentation
  [in context](/type/X/Comp#method_line)
  for **method line**.
  
  The line number in which the compilation error occurred.
  
  # [In Label](#___top "go to top of document")[§](#(Label)_method_line "direct link")
  
  See primary documentation
  [in context](/type/Label#method_line)
  for **method line**.
  
  Returns the line where the label has been defined.
  
  # [In Code](#___top "go to top of document")[§](#(Code)_method_line "direct link")
  
  See primary documentation
  [in context](/type/Code#method_line)
  for **method line**.
  
  ```raku
  method line(Code:D: --> Int:D)
  ```
  
  Returns the line number in the source code at which the code object's declaration begins.
  
  ```raku
  say &infix:<+>.line;   # OUTPUT: «208␤»
  ```
  
  If the code object was generated automatically (and thus *not* declared in the source code), then `line` returns the line on which the enclosing scope's declaration begins. For example, when called on an [automatically generated accessor method](/language/objects#Attributes) produced by the `has $.name` syntax, `line` returns the line on which the method's class's declaration begins.
  
  For example, if you have the following source file:
  
  ```raku
  class Food {                # Line 1
      has $.ingredients;      # Line 2
                              # Line 3
      method eat {};          # Line 4
  }                           # Line 5
  ```
  
  Then the `line` method would give you the following output:
  
  ```raku
  say Food.^lookup('eat').line;          # OUTPUT: «4␤»
  say Food.^lookup('ingredients').line;  # OUTPUT: «1␤»
  
  ```
  
  # [In CallFrame](#___top "go to top of document")[§](#(CallFrame)_method_line "direct link")
  
  See primary documentation
  [in context](/type/CallFrame#method_line)
  for **method line**.
  
  ```raku
  method line()
  ```
  
  This is a shortcut for looking up the `line` annotation. For example, the following two calls are identical.
  
  ```raku
  say callframe(1).line;
  say callframe(1).annotations<line>;
  ```
  