compilation_unit {
  package_statement {
    package_name: "ExplorerTest"
  }
  is_api: true
  declarations {
    choice {
      name {
        name: "MyOptionalElement"
      }
      alternatives {
        name: "None"
        signature {
          fields {
            identifier {
              name: "ZZ"
            }
          }
        }
      }
      alternatives {
        name: "Element"
        signature {
          fields {
            identifier {
              name: "ZZ"
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "Main"
      }
      param_pattern {
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "f"
                type {
                  expression_pattern {
                    expression {
                      call {
                        function {
                          identifier {
                            name: "MyOptionalElement"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              int_type_literal {
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          assign {
            lhs {
              identifier {
                name: "f"
              }
            }
            rhs {
              call {
                function {
                  simple_member_access {
                    field: "None"
                    object {
                      call {
                        function {
                          identifier {
                            name: "MyOptionalElement"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              int_type_literal {
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      int_literal {
                        value: 22
                      }
                    }
                  }
                }
              }
            }
            op: Plain
          }
        }
        statements {
          match {
            expression {
              identifier {
                name: "f"
              }
            }
            clauses {
              pattern {
                alternative_pattern {
                  choice_type {
                    call {
                      function {
                        identifier {
                          name: "MyOptionalElement"
                        }
                      }
                      argument {
                        tuple_literal {
                          fields {
                            int_type_literal {
                            }
                          }
                        }
                      }
                    }
                  }
                  alternative_name: "None"
                  arguments {
                    fields {
                      var_pattern {
                        pattern {
                          binding_pattern {
                            name: "x"
                            type {
                              expression_pattern {
                                expression {
                                  int_type_literal {
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              statement {
                block {
                  statements {
                    return_expression_statement {
                      expression {
                        identifier {
                          name: "x"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        statements {
          return_expression_statement {
            expression {
              int_literal {
                value: 0
              }
            }
          }
        }
      }
    }
  }
}
