================================================================================
Class method with single parameter
================================================================================

class A {
  private int GetBack(int b) {
    return b;
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (modifier)
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (predefined_type)
            (identifier)))
        (block
          (return_statement
            (identifier)))))))

================================================================================
Class method with multiple parameters
================================================================================

class A {
  void DoSomething(A a, B b) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (identifier)
            (identifier))
          (parameter
            (identifier)
            (identifier)))
        (block)))))

================================================================================
Class generic method
================================================================================

class A {
  void Accept<T>(T accept) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (type_parameter_list
          (type_parameter
            (identifier)))
        (parameter_list
          (parameter
            (identifier)
            (identifier)))
        (block)))))

================================================================================
Class generic method with new type constraint
================================================================================

class A {
  void Accept<T>(T accept) where T: new() {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (type_parameter_list
          (type_parameter
            (identifier)))
        (parameter_list
          (parameter
            (identifier)
            (identifier)))
        (type_parameter_constraints_clause
          (identifier)
          (type_parameter_constraint
            (constructor_constraint)))
        (block)))))

================================================================================
Class generic method with multiple type constraints
================================================================================

class A {
  void Accept<T1, T2>(T1 accept, T2 from)
    where T1: new()
    where T2: T1, new() {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (type_parameter_list
          (type_parameter
            (identifier))
          (type_parameter
            (identifier)))
        (parameter_list
          (parameter
            (identifier)
            (identifier))
          (parameter
            (identifier)
            (identifier)))
        (type_parameter_constraints_clause
          (identifier)
          (type_parameter_constraint
            (constructor_constraint)))
        (type_parameter_constraints_clause
          (identifier)
          (type_parameter_constraint
            (type_constraint
              (identifier)))
          (type_parameter_constraint
            (constructor_constraint)))
        (block)))))

================================================================================
Class method with out parameter
================================================================================

class A {
  void HasAnOut(out int a) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (parameter_modifier)
            (predefined_type)
            (identifier)))
        (block)))))

================================================================================
Class method with in parameter
================================================================================

class A {
  void HasAnOut(in int a) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (parameter_modifier)
            (predefined_type)
            (identifier)))
        (block)))))

================================================================================
Class method with ref parameter
================================================================================

class A {
  void HasAnOut(ref int a) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (parameter_modifier)
            (predefined_type)
            (identifier)))
        (block)))))

================================================================================
Class method with contextually-reserved keyword named parameters
================================================================================

class A {
  void HasAnOut(int from, string partial) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (predefined_type)
            (identifier))
          (parameter
            (predefined_type)
            (identifier)))
        (block)))))

================================================================================
Class method with default parameter
================================================================================

class A {
  void HasAnOut(int a = 5) {
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (predefined_type)
            (identifier)
            (equals_value_clause
              (integer_literal))))
        (block)))))

================================================================================
Class static method with single parameter
================================================================================

class A {
  static int GetBack(int b) {
    return b;
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (modifier)
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (predefined_type)
            (identifier)))
        (block
          (return_statement
            (identifier)))))))

================================================================================
Class method with explicit interface specifier
================================================================================

class A : ISomething {
  int ISomething.GetBack(int b) {
    return b;
  }
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (base_list
      (identifier))
    (declaration_list
      (method_declaration
        (predefined_type)
        (explicit_interface_specifier
          (identifier))
        (identifier)
        (parameter_list
          (parameter
            (predefined_type)
            (identifier)))
        (block
          (return_statement
            (identifier)))))))

================================================================================
Class method with readonly method
================================================================================

class A {
  public readonly double Add => x + y;
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (property_declaration
        (modifier)
        (modifier)
        (predefined_type)
        (identifier)
        (arrow_expression_clause
          (binary_expression
            (identifier)
            (identifier)))))))

================================================================================
Class method with nullable parameter list
================================================================================

class A {
  public int Zero(params int[]? ints) => 0;
}

--------------------------------------------------------------------------------

(compilation_unit
  (class_declaration
    (identifier)
    (declaration_list
      (method_declaration
        (modifier)
        (predefined_type)
        (identifier)
        (parameter_list
          (nullable_type
            (array_type
              (predefined_type)
              (array_rank_specifier)))
          (identifier))
        (arrow_expression_clause
          (integer_literal))))))

================================================================================
Method with scoped parameter and scoped local variable
================================================================================

ref struct S {
    void M(scoped ref System.Span<int> p) {
        scoped ref System.Span<int> i = ref p;
        scoped System.Span<int> j = p;
    }
}

--------------------------------------------------------------------------------

(compilation_unit
  (struct_declaration
    (modifier)
    (identifier)
    (declaration_list
      (method_declaration
        (predefined_type)
        (identifier)
        (parameter_list
          (parameter
            (parameter_modifier)
            (parameter_modifier)
            (qualified_name
              (identifier)
              (generic_name
                (identifier)
                (type_argument_list
                  (predefined_type))))
            (identifier)))
        (block
          (local_declaration_statement
            (variable_declaration
              (scoped_type
                (ref_type
                  (qualified_name
                    (identifier)
                    (generic_name
                      (identifier)
                      (type_argument_list
                        (predefined_type))))))
              (variable_declarator
                (identifier)
                (equals_value_clause
                  (ref_expression
                    (identifier))))))
          (local_declaration_statement
            (variable_declaration
              (scoped_type
                (qualified_name
                  (identifier)
                  (generic_name
                    (identifier)
                    (type_argument_list
                      (predefined_type)))))
              (variable_declarator
                (identifier)
                (equals_value_clause
                  (identifier))))))))))
