================================================================================
Assignment to Prefix Unary Expressions
================================================================================

a = +a;
a = -a;
a = !a;
a = ~a;
a = ++a;
a = --a;
a = a++;
a = a--;
a = a!;
--------------------------------------------------------------------------------

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (postfix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (postfix_unary_expression
          (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (postfix_unary_expression
          (identifier))))))

================================================================================
Assignment to Binary Expressions
================================================================================

a = a + a;
a = a - a;
a = a * a;
a = a / a;
a = a % a;
a = a & a;
a = a | a;
a = a ^ a;
a = a >> a;
a = a << a;
a = a >>> a;

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier))))))

================================================================================
Assignment to Binary Equality Expressions
================================================================================

a = a == b;
a = a != b;
a = a < b;
a = a <= b;
a = a > b;
a = a >= b;

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier)))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (identifier)
          right: (identifier))))))

================================================================================
Assignment Binary Expressions
================================================================================

a += a;
a -= a;
a *= a;
a /= a;
a %= a;
a++;
a--;
a <<= a;
a >>= a;
a >>>= a;

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (postfix_unary_expression
        (identifier))))
  (global_statement
    (expression_statement
      (postfix_unary_expression
        (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (identifier)))))

================================================================================
Assignment LValue types
================================================================================

a = 1;
a.b = 1;
a[b] = 1;
(a, b) = (1, 2);
(var a, b) = (1, 2);
var x = new A
{
  a = 1,
  [b] = 1
};
(a) = 1;
*p = 0;

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (integer_literal))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (member_access_expression
          expression: (identifier)
          name: (identifier))
        (assignment_operator)
        right: (integer_literal))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (element_access_expression
          expression: (identifier)
          subscript: (bracketed_argument_list
            (argument
              (identifier))))
        (assignment_operator)
        right: (integer_literal))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (tuple_expression
          (argument
            (identifier))
          (argument
            (identifier)))
        (assignment_operator)
        right: (tuple_expression
          (argument
            (integer_literal))
          (argument
            (integer_literal))))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (tuple_expression
          (argument
            (declaration_expression
              type: (implicit_type)
              name: (identifier)))
          (argument
            (identifier)))
        (assignment_operator)
        right: (tuple_expression
          (argument
            (integer_literal))
          (argument
            (integer_literal))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (object_creation_expression
              type: (identifier)
              initializer: (initializer_expression
                (assignment_expression
                  left: (identifier)
                  (assignment_operator)
                  right: (integer_literal))
                (assignment_expression
                  left: (element_binding_expression
                    (bracketed_argument_list
                      (argument
                        (identifier))))
                  (assignment_operator)
                  right: (integer_literal)))))))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (parenthesized_expression
          (identifier))
        (assignment_operator)
        right: (integer_literal))))
  (global_statement
    (expression_statement
      (assignment_expression
        left: (prefix_unary_expression
          (identifier))
        (assignment_operator)
        right: (integer_literal)))))

================================================================================
Ternary Expression
================================================================================

class Foo {
  void Test() {
    var y = x ? "foo" : "bar";
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (conditional_expression
                    condition: (identifier)
                    consequence: (string_literal
                      (string_literal_fragment))
                    alternative: (string_literal
                      (string_literal_fragment))))))))))))

================================================================================
Binary Expressions
================================================================================

class Foo {
  void Test() {
    var b = x == y;
    var i = 1 + 2;
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (binary_expression
                    left: (identifier)
                    right: (identifier))))))
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (binary_expression
                    left: (integer_literal)
                    right: (integer_literal)))))))))))

================================================================================
Ternary expressions is type
================================================================================

var t = x is int
  ? a
  : b;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_expression
              condition: (is_expression
                left: (identifier)
                right: (predefined_type))
              consequence: (identifier)
              alternative: (identifier))))))))

================================================================================
Ternary expressions is nullable type
================================================================================

var u = x is int?
  ? a
  : b;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_expression
              condition: (is_expression
                left: (identifier)
                right: (nullable_type
                  type: (predefined_type)))
              consequence: (identifier)
              alternative: (identifier))))))))

================================================================================
Prefix-Unary Expressions
================================================================================

class Foo {
  void Test() {
    ++x;
    --y;
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (expression_statement
            (prefix_unary_expression
              (identifier)))
          (expression_statement
            (prefix_unary_expression
              (identifier))))))))

================================================================================
Cast expressions
================================================================================

void Test() {
  a = (B)c + (C)d;
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (binary_expression
              left: (cast_expression
                type: (identifier)
                value: (identifier))
              right: (cast_expression
                type: (identifier)
                value: (identifier)))))))))

================================================================================
Cast expression of array access
================================================================================

b = (float)a[0];

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (cast_expression
          type: (predefined_type)
          value: (element_access_expression
            expression: (identifier)
            subscript: (bracketed_argument_list
              (argument
                (integer_literal)))))))))

================================================================================
Cast with parenthesized expression
================================================================================

var o = (A.A)(a.a.a);
var o = (Int32)(1);
var o = (Int32)(1);
var o = (Int32)((1));

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (cast_expression
              type: (qualified_name
                qualifier: (identifier)
                name: (identifier))
              value: (parenthesized_expression
                (member_access_expression
                  expression: (member_access_expression
                    expression: (identifier)
                    name: (identifier))
                  name: (identifier)))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (cast_expression
              type: (identifier)
              value: (parenthesized_expression
                (integer_literal))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (cast_expression
              type: (identifier)
              value: (parenthesized_expression
                (integer_literal))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (cast_expression
              type: (identifier)
              value: (parenthesized_expression
                (parenthesized_expression
                  (integer_literal))))))))))

================================================================================
Precedence of unary prefix operator and element access
================================================================================

b = +a[0];

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (prefix_unary_expression
          (element_access_expression
            expression: (identifier)
            subscript: (bracketed_argument_list
              (argument
                (integer_literal)))))))))

================================================================================
Precedence of switch_expression and binary_expression
================================================================================

b = 2 * a switch
{
    1 => 1,
    _ => 0,
};

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (integer_literal)
          right: (switch_expression
            (identifier)
            (switch_expression_arm
              (constant_pattern
                (integer_literal))
              (integer_literal))
            (switch_expression_arm
              (discard)
              (integer_literal))))))))

================================================================================
Anonymous object creation with empty body
================================================================================

void b() {
  var x = new {
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_object_creation_expression)))))))))

================================================================================
Target-type object creation
================================================================================

void b() {
  Friend friend = new("hi");
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (identifier)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (implicit_object_creation_expression
                  (argument_list
                    (argument
                      (string_literal
                        (string_literal_fragment)))))))))))))

================================================================================
Anonymous object creation with single unnamed
================================================================================

void b() {
  var x = new {
    args
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_object_creation_expression
                  (identifier))))))))))

================================================================================
Anonymous object creation with single named
================================================================================

void b() {
  var x = new {
    test = "This"
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_object_creation_expression
                  (name_equals
                    (identifier))
                  (string_literal
                    (string_literal_fragment)))))))))))

================================================================================
Checked expressions
================================================================================

void b() {
  var three = checked(1 + 2);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (checked_expression
                  (binary_expression
                    left: (integer_literal)
                    right: (integer_literal)))))))))))

================================================================================
Object creation expressions
================================================================================

void b() {
  new C.D(1, "hi");
  a = new E
  {
    Foo = bar,
  };

  b = new E(1);

  c = new E(1) { };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (object_creation_expression
            type: (qualified_name
              qualifier: (identifier)
              name: (identifier))
            arguments: (argument_list
              (argument
                (integer_literal))
              (argument
                (string_literal
                  (string_literal_fragment))))))
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (object_creation_expression
              type: (identifier)
              initializer: (initializer_expression
                (assignment_expression
                  left: (identifier)
                  (assignment_operator)
                  right: (identifier))))))
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (object_creation_expression
              type: (identifier)
              arguments: (argument_list
                (argument
                  (integer_literal))))))
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (object_creation_expression
              type: (identifier)
              arguments: (argument_list
                (argument
                  (integer_literal)))
              initializer: (initializer_expression))))))))

================================================================================
Named parameters in constructors
================================================================================

void b() {
  var z = new C(a: 1, b: "hi");
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (object_creation_expression
                  type: (identifier)
                  arguments: (argument_list
                    (argument
                      name: (name_colon
                        name: (identifier))
                      (integer_literal))
                    (argument
                      name: (name_colon
                        name: (identifier))
                      (string_literal
                        (string_literal_fragment)))))))))))))

================================================================================
Named parameters in method calls
================================================================================

void b() {
  z = A.B(a: 1, b: "hi");
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (invocation_expression
              function: (member_access_expression
                expression: (identifier)
                name: (identifier))
              arguments: (argument_list
                (argument
                  name: (name_colon
                    name: (identifier))
                  (integer_literal))
                (argument
                  name: (name_colon
                    name: (identifier))
                  (string_literal
                    (string_literal_fragment)))))))))))

================================================================================
Named parameters using contextually reserved words
================================================================================

void b() {
  resultNode  = B(from: 1, into: "hi");
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (invocation_expression
              function: (identifier)
              arguments: (argument_list
                (argument
                  name: (name_colon
                    name: (identifier))
                  (integer_literal))
                (argument
                  name: (name_colon
                    name: (identifier))
                  (string_literal
                    (string_literal_fragment)))))))))))

================================================================================
Anonymous method expressions
================================================================================

void a() {
  var d = delegate(int a) {
    return a;
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_method_expression
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  (block
                    (return_statement
                      (identifier))))))))))))

================================================================================
Anonymous method expression with discard parameters
================================================================================

void a() {
  var d = delegate(int _, int _) {
    return a;
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_method_expression
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier))
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  (block
                    (return_statement
                      (identifier))))))))))))

================================================================================
Anonymous method expression with modifiers
================================================================================

void m() {
  var a = static delegate(int a) { return a; };
  var b = async delegate(int a) { return a; };
  var c = async static delegate(int a) { return a; };
  var d = static async delegate(int a) { return a; };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_method_expression
                  (modifier)
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  (block
                    (return_statement
                      (identifier))))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_method_expression
                  (modifier)
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  (block
                    (return_statement
                      (identifier))))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_method_expression
                  (modifier)
                  (modifier)
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  (block
                    (return_statement
                      (identifier))))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (anonymous_method_expression
                  (modifier)
                  (modifier)
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  (block
                    (return_statement
                      (identifier))))))))))))

================================================================================
Lambda expressions
================================================================================

void a() {
  var l = x => x + 1;
  var l = (A a, B b) => { return a.c(b); };
  var l = RetType (A a, B b) => { return 1; };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  parameters: (implicit_parameter_list
                    (parameter
                      name: (identifier)))
                  body: (binary_expression
                    left: (identifier)
                    right: (integer_literal)))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  parameters: (parameter_list
                    (parameter
                      type: (identifier)
                      name: (identifier))
                    (parameter
                      type: (identifier)
                      name: (identifier)))
                  body: (block
                    (return_statement
                      (invocation_expression
                        function: (member_access_expression
                          expression: (identifier)
                          name: (identifier))
                        arguments: (argument_list
                          (argument
                            (identifier)))))))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  type: (identifier)
                  parameters: (parameter_list
                    (parameter
                      type: (identifier)
                      name: (identifier))
                    (parameter
                      type: (identifier)
                      name: (identifier)))
                  body: (block
                    (return_statement
                      (integer_literal))))))))))))

================================================================================
Async Lambda
================================================================================

void a()
{
    Do(async () => {});
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (invocation_expression
            function: (identifier)
            arguments: (argument_list
              (argument
                (lambda_expression
                  (modifier)
                  parameters: (parameter_list)
                  body: (initializer_expression))))))))))

================================================================================
Lambda expression with modifiers
================================================================================

void a() {
  var lam = static x => x + 1;
  var bda = async x => x + 1;
  var syn = async static x => x + 1;
  var txt = static async x => x + 1;
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  (modifier)
                  parameters: (implicit_parameter_list
                    (parameter
                      name: (identifier)))
                  body: (binary_expression
                    left: (identifier)
                    right: (integer_literal)))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  (modifier)
                  parameters: (implicit_parameter_list
                    (parameter
                      name: (identifier)))
                  body: (binary_expression
                    left: (identifier)
                    right: (integer_literal)))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  (modifier)
                  (modifier)
                  parameters: (implicit_parameter_list
                    (parameter
                      name: (identifier)))
                  body: (binary_expression
                    left: (identifier)
                    right: (integer_literal)))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  (modifier)
                  (modifier)
                  parameters: (implicit_parameter_list
                    (parameter
                      name: (identifier)))
                  body: (binary_expression
                    left: (identifier)
                    right: (integer_literal)))))))))))

================================================================================
Lambda expression with discard parameters
================================================================================

void a() {
  var lam = (_, _) => 0;
  var bda = (int _, int _) => 0;
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  parameters: (parameter_list
                    (parameter
                      name: (identifier))
                    (parameter
                      name: (identifier)))
                  body: (integer_literal))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (lambda_expression
                  parameters: (parameter_list
                    (parameter
                      type: (predefined_type)
                      name: (identifier))
                    (parameter
                      type: (predefined_type)
                      name: (identifier)))
                  body: (integer_literal))))))))))

================================================================================
Lambda expression with ref modifier
================================================================================

MyIntDelegate a = (ref int i) => i + 1;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (identifier)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (lambda_expression
              parameters: (parameter_list
                (parameter
                  (parameter_modifier)
                  type: (predefined_type)
                  name: (identifier)))
              body: (binary_expression
                left: (identifier)
                right: (integer_literal)))))))))

================================================================================
Invocation expressions
================================================================================

void a() {
  b(c, in d, out e, ref f, out var g);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (invocation_expression
            function: (identifier)
            arguments: (argument_list
              (argument
                (identifier))
              (argument
                (identifier))
              (argument
                (identifier))
              (argument
                (identifier))
              (argument
                (declaration_expression
                  type: (implicit_type)
                  name: (identifier))))))))))

================================================================================
Tuple expressions
================================================================================

void a() {
  b = (c, d: "e");
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (assignment_expression
            left: (identifier)
            (assignment_operator)
            right: (tuple_expression
              (argument
                (identifier))
              (argument
                name: (name_colon
                  name: (identifier))
                (string_literal
                  (string_literal_fragment))))))))))

================================================================================
Implicit array creation
================================================================================

void b() {
  var z = new [] { 1, 2, 3 };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (implicit_array_creation_expression
                  (initializer_expression
                    (integer_literal)
                    (integer_literal)
                    (integer_literal)))))))))))

================================================================================
Implicit multi array creation
================================================================================

void b() {
  var z = new [,] { { 1, 1 }, { 2, 2 }, { 3, 3 } };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (implicit_array_creation_expression
                  (initializer_expression
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))))))))))))

================================================================================
Stackalloc implicit array
================================================================================

void b() {
  var z = stackalloc [] { 1, 2, 3 };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (implicit_stack_alloc_array_creation_expression
                  (initializer_expression
                    (integer_literal)
                    (integer_literal)
                    (integer_literal)))))))))))

================================================================================
Stackalloc explicit array
================================================================================

void b() {
  var z = stackalloc int[] { 1, 2, 3 };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (stack_alloc_array_creation_expression
                  type: (array_type
                    type: (predefined_type)
                    rank: (array_rank_specifier))
                  (initializer_expression
                    (integer_literal)
                    (integer_literal)
                    (integer_literal)))))))))))

================================================================================
Explicit array creation
================================================================================

void b() {
  var z = new int[3] { 1, 2, 3 };
  var b = new byte[,] { { 1, 2 }, { 2, 3 } };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (array_creation_expression
                  type: (array_type
                    type: (predefined_type)
                    rank: (array_rank_specifier
                      (integer_literal)))
                  (initializer_expression
                    (integer_literal)
                    (integer_literal)
                    (integer_literal)))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (array_creation_expression
                  type: (array_type
                    type: (predefined_type)
                    rank: (array_rank_specifier))
                  (initializer_expression
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))))))))))))

================================================================================
Explicit multi array creation
================================================================================

void b() {
  var z = new int[3,2] { { 1, 1 }, { 2, 2 }, { 3, 3 } };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (array_creation_expression
                  type: (array_type
                    type: (predefined_type)
                    rank: (array_rank_specifier
                      (integer_literal)
                      (integer_literal)))
                  (initializer_expression
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))
                    (initializer_expression
                      (integer_literal)
                      (integer_literal))))))))))))

================================================================================
Array of named tuple
================================================================================

void a() {
  var z = new (string b, string c)[3];
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (array_creation_expression
                  type: (array_type
                    type: (tuple_type
                      (tuple_element
                        type: (predefined_type)
                        name: (identifier))
                      (tuple_element
                        type: (predefined_type)
                        name: (identifier)))
                    rank: (array_rank_specifier
                      (integer_literal))))))))))))

================================================================================
Makeref
================================================================================

void b() {
  var gp = __makeref(g);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (make_ref_expression
                  (identifier))))))))))

================================================================================
Postfix unary
================================================================================

void b() {
  a--;
  a++;
  var b=a!;
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (postfix_unary_expression
            (identifier)))
        (expression_statement
          (postfix_unary_expression
            (identifier)))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (postfix_unary_expression
                  (identifier))))))))))

================================================================================
__reftype
================================================================================

void b() {
  var z = __reftype(g);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (ref_type_expression
                  (identifier))))))))))

================================================================================
__refvalue
================================================================================

void b() {
  var z = __refvalue(g, int);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (ref_value_expression
                  value: (identifier)
                  type: (predefined_type))))))))))

================================================================================
sizeof
================================================================================

void b() {
  var z = sizeof(int);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (size_of_expression
                  type: (predefined_type))))))))))

================================================================================
typeof
================================================================================

void b() {
  var y = typeof(int);
  var z = typeof(List<string>.Enumerator);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (type_of_expression
                  type: (predefined_type))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (type_of_expression
                  type: (qualified_name
                    qualifier: (generic_name
                      name: (identifier)
                      type_arguments: (type_argument_list
                        (predefined_type)))
                    name: (identifier)))))))))))

================================================================================
switch expression
================================================================================

void b() {
  var r = operation switch {
      1 => "one",
      2 => "two",
      _ => "more"
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (switch_expression
                  (identifier)
                  (switch_expression_arm
                    (constant_pattern
                      (integer_literal))
                    (string_literal
                      (string_literal_fragment)))
                  (switch_expression_arm
                    (constant_pattern
                      (integer_literal))
                    (string_literal
                      (string_literal_fragment)))
                  (switch_expression_arm
                    (discard)
                    (string_literal
                      (string_literal_fragment))))))))))))

================================================================================
switch expression with trailing comma
================================================================================

void b() {
  var r = operation switch {
      1 => "one",
      2 => "two",
      _ => "more",
  };
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (switch_expression
                  (identifier)
                  (switch_expression_arm
                    (constant_pattern
                      (integer_literal))
                    (string_literal
                      (string_literal_fragment)))
                  (switch_expression_arm
                    (constant_pattern
                      (integer_literal))
                    (string_literal
                      (string_literal_fragment)))
                  (switch_expression_arm
                    (discard)
                    (string_literal
                      (string_literal_fragment))))))))))))

================================================================================
switch expression return
================================================================================

string b(Object operation) =>
  operation switch {
      1 => "one",
      _ => "more",
  };

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list
        (parameter
          type: (identifier)
          name: (identifier)))
      body: (arrow_expression_clause
        (switch_expression
          (identifier)
          (switch_expression_arm
            (constant_pattern
              (integer_literal))
            (string_literal
              (string_literal_fragment)))
          (switch_expression_arm
            (discard)
            (string_literal
              (string_literal_fragment))))))))

================================================================================
switch expression with patterns
================================================================================

string b(Object operation) =>
  operation switch {
      Declaration d => "declaration",
      Simple => "simple (constant)",
      { } => "nothing",
      var z => "var",
      null => "constant",
      int => "type"
  };

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list
        (parameter
          type: (identifier)
          name: (identifier)))
      body: (arrow_expression_clause
        (switch_expression
          (identifier)
          (switch_expression_arm
            (declaration_pattern
              type: (identifier)
              name: (identifier))
            (string_literal
              (string_literal_fragment)))
          (switch_expression_arm
            (constant_pattern
              (identifier))
            (string_literal
              (string_literal_fragment)))
          (switch_expression_arm
            (recursive_pattern
              (property_pattern_clause))
            (string_literal
              (string_literal_fragment)))
          (switch_expression_arm
            (var_pattern
              name: (identifier))
            (string_literal
              (string_literal_fragment)))
          (switch_expression_arm
            (constant_pattern
              (null_literal))
            (string_literal
              (string_literal_fragment)))
          (switch_expression_arm
            (type_pattern
              type: (predefined_type))
            (string_literal
              (string_literal_fragment))))))))

================================================================================
await Expression
================================================================================

class Foo {
  void Test() {
    await x;
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (expression_statement
            (await_expression
              (identifier))))))))

================================================================================
throw expression
================================================================================

class Foo {
  void Test() {
    x = x ?? throw y;
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (expression_statement
            (assignment_expression
              left: (identifier)
              (assignment_operator)
              right: (binary_expression
                left: (identifier)
                right: (throw_expression
                  (identifier))))))))))

================================================================================
Pecedence with OR and XOR
================================================================================

b = 4 | 5 ^ 6;

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

(compilation_unit
  (global_statement
    (expression_statement
      (assignment_expression
        left: (identifier)
        (assignment_operator)
        right: (binary_expression
          left: (integer_literal)
          right: (binary_expression
            left: (integer_literal)
            right: (integer_literal)))))))

================================================================================
range expressions full
================================================================================

class Foo {
  void Test() {
    var a = b[1..4];
    var c = 1..^4;
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (element_access_expression
                    expression: (identifier)
                    subscript: (bracketed_argument_list
                      (argument
                        (range_expression
                          (integer_literal)
                          (integer_literal)))))))))
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (range_expression
                    (integer_literal)
                    (prefix_unary_expression
                      (integer_literal))))))))))))

================================================================================
range expressions partial
================================================================================

class Foo {
  void Test() {
    var a = b[..4];
    var c = ^1..;
    var d = b[..];
  }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (element_access_expression
                    expression: (identifier)
                    subscript: (bracketed_argument_list
                      (argument
                        (range_expression
                          (integer_literal)))))))))
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (range_expression
                    (prefix_unary_expression
                      (integer_literal)))))))
          (local_declaration_statement
            (variable_declaration
              type: (implicit_type)
              (variable_declarator
                name: (identifier)
                (equals_value_clause
                  (element_access_expression
                    expression: (identifier)
                    subscript: (bracketed_argument_list
                      (argument
                        (range_expression)))))))))))))

================================================================================
cast expression
================================================================================

class Foo {
  void Test() {
    x = (int) y;
      }
}

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

(compilation_unit
  (class_declaration
    name: (identifier)
    body: (declaration_list
      (method_declaration
        type: (predefined_type)
        name: (identifier)
        parameters: (parameter_list)
        body: (block
          (expression_statement
            (assignment_expression
              left: (identifier)
              (assignment_operator)
              right: (cast_expression
                type: (predefined_type)
                value: (identifier)))))))))

================================================================================
Generic type name no type args
================================================================================

var d = typeof(Dictionary<,>);
var t = typeof(Tuple<,,,>);

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (type_of_expression
              type: (generic_name
                name: (identifier)
                type_arguments: (type_argument_list))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (type_of_expression
              type: (generic_name
                name: (identifier)
                type_arguments: (type_argument_list)))))))))

================================================================================
default expression
================================================================================

var a = default(int);
int b = default;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (default_expression
              type: (predefined_type)))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (predefined_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (default_expression)))))))

================================================================================
Ref local declaration and ref expression
================================================================================

ref VeryLargeStruct reflocal = ref veryLargeStruct;
ref var elementRef = ref arr[0];

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (ref_type
          type: (identifier))
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (ref_expression
              (identifier)))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (ref_type
          type: (implicit_type))
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (ref_expression
              (element_access_expression
                expression: (identifier)
                subscript: (bracketed_argument_list
                  (argument
                    (integer_literal)))))))))))

================================================================================
Element binding expression
================================================================================

var x = new Dictionary<string,int> { ["a"] = 65 };

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (object_creation_expression
              type: (generic_name
                name: (identifier)
                type_arguments: (type_argument_list
                  (predefined_type)
                  (predefined_type)))
              initializer: (initializer_expression
                (assignment_expression
                  left: (element_binding_expression
                    (bracketed_argument_list
                      (argument
                        (string_literal
                          (string_literal_fragment)))))
                  (assignment_operator)
                  right: (integer_literal))))))))))

================================================================================
Member access expression (methods)
================================================================================

void Test(int value) {
  value.ToString();
  double.IsInfinity(value);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list
        (parameter
          type: (predefined_type)
          name: (identifier)))
      body: (block
        (expression_statement
          (invocation_expression
            function: (member_access_expression
              expression: (identifier)
              name: (identifier))
            arguments: (argument_list)))
        (expression_statement
          (invocation_expression
            function: (member_access_expression
              expression: (predefined_type)
              name: (identifier))
            arguments: (argument_list
              (argument
                (identifier)))))))))

================================================================================
Member access expression (properties)
================================================================================

void Test(int value) {
  var x = string.Empty;
  var z = B<int>.Something;
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list
        (parameter
          type: (predefined_type)
          name: (identifier)))
      body: (block
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (member_access_expression
                  expression: (predefined_type)
                  name: (identifier))))))
        (local_declaration_statement
          (variable_declaration
            type: (implicit_type)
            (variable_declarator
              name: (identifier)
              (equals_value_clause
                (member_access_expression
                  expression: (generic_name
                    name: (identifier)
                    type_arguments: (type_argument_list
                      (predefined_type)))
                  name: (identifier))))))))))

================================================================================
is expression
================================================================================

var b = s is string;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_expression
              left: (identifier)
              right: (predefined_type))))))))

================================================================================
is pattern
================================================================================

var b = s is string s2;
var c = s is "test";
var a = 1 is int.MaxValue;
var d = a is nameof(a);
var e = a is (int)b;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (declaration_pattern
                type: (predefined_type)
                name: (identifier))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (constant_pattern
                (string_literal
                  (string_literal_fragment)))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (integer_literal)
              pattern: (constant_pattern
                (member_access_expression
                  expression: (predefined_type)
                  name: (identifier)))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (constant_pattern
                (invocation_expression
                  function: (identifier)
                  arguments: (argument_list
                    (argument
                      (identifier)))))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (constant_pattern
                (cast_expression
                  type: (predefined_type)
                  value: (identifier))))))))))

================================================================================
Precedence between is operator and conditional_expression
================================================================================

int a = 1 is Object ? 1 : 2;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (predefined_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_expression
              condition: (is_pattern_expression
                expression: (integer_literal)
                pattern: (constant_pattern
                  (identifier)))
              consequence: (integer_literal)
              alternative: (integer_literal))))))))

================================================================================
Precedence between is operator and as operator
================================================================================

//var a = new object() is null as Object == false; // this parses with wrong precedence
var a = new object() is null as Object;
var b = true == 1 as int? is int;

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

(compilation_unit
  (comment)
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (as_expression
              left: (is_pattern_expression
                expression: (object_creation_expression
                  type: (predefined_type)
                  arguments: (argument_list))
                pattern: (constant_pattern
                  (null_literal)))
              right: (identifier)))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (binary_expression
              left: (boolean_literal)
              right: (is_expression
                left: (as_expression
                  left: (integer_literal)
                  right: (nullable_type
                    type: (predefined_type)))
                right: (predefined_type)))))))))

================================================================================
Discard pattern
================================================================================

void Do() {
  DateTime.TryParse(dateString, out _);
}

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

(compilation_unit
  (global_statement
    (local_function_statement
      type: (predefined_type)
      name: (identifier)
      parameters: (parameter_list)
      body: (block
        (expression_statement
          (invocation_expression
            function: (member_access_expression
              expression: (identifier)
              name: (identifier))
            arguments: (argument_list
              (argument
                (identifier))
              (argument
                (identifier)))))))))

================================================================================
Null-forgiving operator
================================================================================

var x = name!.Length;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (member_access_expression
              expression: (postfix_unary_expression
                (identifier))
              name: (identifier))))))))

================================================================================
Negated pattern
================================================================================

var x = name is not null;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (negated_pattern
                (constant_pattern
                  (null_literal))))))))))

================================================================================
Parenthesized pattern
================================================================================

var x = name is (var a);

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (parenthesized_pattern
                (var_pattern
                  name: (identifier))))))))))

================================================================================
Pattern Combinators and relational pattern
================================================================================

var x = c is < '0' or >= 'A' and <= 'Z';

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (or_pattern
                left: (relational_pattern
                  (character_literal
                    (character_literal_unescaped)))
                right: (and_pattern
                  left: (relational_pattern
                    (character_literal
                      (character_literal_unescaped)))
                  right: (relational_pattern
                    (character_literal
                      (character_literal_unescaped))))))))))))

================================================================================
Precedence of prefix_unary_expression and invocation_expression
================================================================================

var x = !this.Call();

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (prefix_unary_expression
              (invocation_expression
                function: (member_access_expression
                  expression: (this_expression)
                  name: (identifier))
                arguments: (argument_list)))))))))

================================================================================
Property patterns
================================================================================

var x = operand is ILiteralOperation { ConstantValue: { HasValue: true, Value: null } };
var x = operand is ILiteralOperation { ConstantValue.HasValue: true, ConstantValue.Value: null};

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (recursive_pattern
                type: (identifier)
                (property_pattern_clause
                  (subpattern
                    (expression_colon
                      (identifier))
                    (recursive_pattern
                      (property_pattern_clause
                        (subpattern
                          (expression_colon
                            (identifier))
                          (constant_pattern
                            (boolean_literal)))
                        (subpattern
                          (expression_colon
                            (identifier))
                          (constant_pattern
                            (null_literal))))))))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (recursive_pattern
                type: (identifier)
                (property_pattern_clause
                  (subpattern
                    (expression_colon
                      (member_access_expression
                        expression: (identifier)
                        name: (identifier)))
                    (constant_pattern
                      (boolean_literal)))
                  (subpattern
                    (expression_colon
                      (member_access_expression
                        expression: (identifier)
                        name: (identifier)))
                    (constant_pattern
                      (null_literal))))))))))))

================================================================================
Positional patterns
================================================================================

var a = p is var (x, y);
var c = p is (var x, var y) { x: 0 };

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (var_pattern
                (parenthesized_variable_designation
                  name: (identifier)
                  name: (identifier)))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (recursive_pattern
                (positional_pattern_clause
                  (subpattern
                    (var_pattern
                      name: (identifier)))
                  (subpattern
                    (var_pattern
                      name: (identifier))))
                (property_pattern_clause
                  (subpattern
                    (expression_colon
                      (identifier))
                    (constant_pattern
                      (integer_literal))))))))))))

================================================================================
Type patterns
================================================================================

var b = o is int or string; //is_pattern_expression with type_pattern
var c = o is int; //is_expression with type

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (or_pattern
                left: (type_pattern
                  type: (predefined_type))
                right: (type_pattern
                  type: (predefined_type)))))))))
  (comment)
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_expression
              left: (identifier)
              right: (predefined_type)))))))
  (comment))

================================================================================
List patterns
================================================================================

var a = p is [1,2,x,] and [] or [2,..];

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (is_pattern_expression
              expression: (identifier)
              pattern: (or_pattern
                left: (and_pattern
                  left: (list_pattern
                    (constant_pattern
                      (integer_literal))
                    (constant_pattern
                      (integer_literal))
                    (constant_pattern
                      (identifier)))
                  right: (list_pattern))
                right: (list_pattern
                  (constant_pattern
                    (integer_literal))
                  (slice_pattern))))))))))

================================================================================
Conditional expression with member accesses
================================================================================

var a = b ? c.A + d.A : e.A + f.A;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_expression
              condition: (identifier)
              consequence: (binary_expression
                left: (member_access_expression
                  expression: (identifier)
                  name: (identifier))
                right: (member_access_expression
                  expression: (identifier)
                  name: (identifier)))
              alternative: (binary_expression
                left: (member_access_expression
                  expression: (identifier)
                  name: (identifier))
                right: (member_access_expression
                  expression: (identifier)
                  name: (identifier))))))))))

================================================================================
Conditional access expression
================================================================================

var a = b?.Something;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_access_expression
              condition: (identifier)
              (member_binding_expression
                name: (identifier)))))))))

================================================================================
Conditional access to element (should be implicit_element_access)
================================================================================

var x = dict?["a"];

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_access_expression
              condition: (identifier)
              (element_binding_expression
                (bracketed_argument_list
                  (argument
                    (string_literal
                      (string_literal_fragment))))))))))))

================================================================================
Conditional access expression with member binding
================================================================================

if (a?.B != 1) { }

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

(compilation_unit
  (global_statement
    (if_statement
      condition: (binary_expression
        left: (conditional_access_expression
          condition: (identifier)
          (member_binding_expression
            name: (identifier)))
        right: (integer_literal))
      consequence: (block))))

================================================================================
Conditional access expression with simple member access
================================================================================

if ((p as Person[])?[0]._Age != 1) { }

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

(compilation_unit
  (global_statement
    (if_statement
      condition: (binary_expression
        left: (member_access_expression
          expression: (conditional_access_expression
            condition: (parenthesized_expression
              (as_expression
                left: (identifier)
                right: (array_type
                  type: (identifier)
                  rank: (array_rank_specifier))))
            (element_binding_expression
              (bracketed_argument_list
                (argument
                  (integer_literal)))))
          name: (identifier))
        right: (integer_literal))
      consequence: (block))))

================================================================================
Null-coalescing operator is right-associative
================================================================================

var a = b ?? c ?? d;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (binary_expression
              left: (identifier)
              right: (binary_expression
                left: (identifier)
                right: (identifier)))))))))

================================================================================
Precedence between null-coalescing operator and conditional OR
================================================================================

var a = b ?? c || d ?? e;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (binary_expression
              left: (identifier)
              right: (binary_expression
                left: (binary_expression
                  left: (identifier)
                  right: (identifier))
                right: (identifier)))))))))

================================================================================
Precedence between null-coalescing operator and conditional operator
================================================================================

var a = b ?? c ? d ?? e : f ?? g;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_expression
              condition: (binary_expression
                left: (identifier)
                right: (identifier))
              consequence: (binary_expression
                left: (identifier)
                right: (identifier))
              alternative: (binary_expression
                left: (identifier)
                right: (identifier)))))))))

================================================================================
Precedence between range and switch
================================================================================

var a = 3..4 switch
{
    _ => true
};

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (switch_expression
              (range_expression
                (integer_literal)
                (integer_literal))
              (switch_expression_arm
                (discard)
                (boolean_literal)))))))))

================================================================================
Precedence between unary and switch
================================================================================

var a = -3 switch
{
    _ => true
};

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (switch_expression
              (prefix_unary_expression
                (integer_literal))
              (switch_expression_arm
                (discard)
                (boolean_literal)))))))))

================================================================================
Precedence between range and as operator
================================================================================

var a = 3..4 as Range;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (as_expression
              left: (range_expression
                (integer_literal)
                (integer_literal))
              right: (identifier))))))))

================================================================================
Precedence between is and comparison operators
================================================================================

var allowedValuesList = someObj is null
    ? default
    : new object();

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (conditional_expression
              condition: (is_pattern_expression
                expression: (identifier)
                pattern: (constant_pattern
                  (null_literal)))
              consequence: (default_expression)
              alternative: (object_creation_expression
                type: (predefined_type)
                arguments: (argument_list)))))))))

================================================================================
Nameof expressions
================================================================================

var x = nameof(A);
var x = nameof(A<B>);
var x = nameof(A.B);

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (invocation_expression
              function: (identifier)
              arguments: (argument_list
                (argument
                  (identifier)))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (invocation_expression
              function: (identifier)
              arguments: (argument_list
                (argument
                  (generic_name
                    name: (identifier)
                    type_arguments: (type_argument_list
                      (identifier)))))))))))
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (implicit_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (invocation_expression
              function: (identifier)
              arguments: (argument_list
                (argument
                  (member_access_expression
                    expression: (identifier)
                    name: (identifier)))))))))))

================================================================================
Generic invocation expression
================================================================================

MyFunction<A,B>(1);

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

(compilation_unit
  (global_statement
    (expression_statement
      (invocation_expression
        function: (generic_name
          name: (identifier)
          type_arguments: (type_argument_list
            (identifier)
            (identifier)))
        arguments: (argument_list
          (argument
            (integer_literal)))))))

================================================================================
Dereference versus logical and
================================================================================

bool c = (a) && b;

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

(compilation_unit
  (global_statement
    (local_declaration_statement
      (variable_declaration
        type: (predefined_type)
        (variable_declarator
          name: (identifier)
          (equals_value_clause
            (binary_expression
              left: (parenthesized_expression
                (identifier))
              right: (identifier))))))))
