compilation_unit {
  package_statement {
    package_name: "ExplorerTest"
  }
  is_api: true
  declarations {
    interface {
      name {
        name: "Number"
      }
      members {
        function {
          name {
            name: "Zero"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "Self"
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "Add"
          }
          self_pattern {
            binding_pattern {
              name: "self"
              type {
                expression_pattern {
                  expression {
                    identifier {
                      name: "Self"
                    }
                  }
                }
              }
            }
          }
          param_pattern {
            fields {
              binding_pattern {
                name: "other"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "Self"
                      }
                    }
                  }
                }
              }
            }
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "Self"
              }
            }
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name {
        name: "Point"
      }
      members {
        function {
          name {
            name: "Origin"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              call {
                function {
                  identifier {
                    name: "Point"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      identifier {
                        name: "T"
                      }
                    }
                  }
                }
              }
            }
          }
          body {
            statements {
              return_expression_statement {
                expression {
                  struct_literal {
                    fields {
                      name: "x"
                      expression {
                        call {
                          function {
                            simple_member_access {
                              field: "Zero"
                              object {
                                identifier {
                                  name: "T"
                                }
                              }
                            }
                          }
                          argument {
                            tuple_literal {
                            }
                          }
                        }
                      }
                    }
                    fields {
                      name: "y"
                      expression {
                        call {
                          function {
                            simple_member_access {
                              field: "Zero"
                              object {
                                identifier {
                                  name: "T"
                                }
                              }
                            }
                          }
                          argument {
                            tuple_literal {
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      members {
        variable {
          binding {
            name: "x"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      members {
        variable {
          binding {
            name: "y"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      type_params {
        fields {
          generic_binding {
            name: "T"
            type {
              identifier {
                name: "Number"
              }
            }
          }
        }
      }
    }
  }
  declarations {
    impl {
      kind: ExternalImpl
      impl_type {
        int_type_literal {
        }
      }
      interface {
        identifier {
          name: "Number"
        }
      }
      members {
        function {
          name {
            name: "Zero"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              int_type_literal {
              }
            }
          }
          body {
            statements {
              return_expression_statement {
                expression {
                  int_literal {
                    value: 0
                  }
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "Add"
          }
          self_pattern {
            binding_pattern {
              name: "self"
              type {
                expression_pattern {
                  expression {
                    int_type_literal {
                    }
                  }
                }
              }
            }
          }
          param_pattern {
            fields {
              binding_pattern {
                name: "other"
                type {
                  expression_pattern {
                    expression {
                      int_type_literal {
                      }
                    }
                  }
                }
              }
            }
          }
          return_term {
            kind: Expression
            type {
              int_type_literal {
              }
            }
          }
          body {
            statements {
              return_expression_statement {
                expression {
                  operator {
                    op: Add
                    arguments {
                      identifier {
                        name: "self"
                      }
                    }
                    arguments {
                      identifier {
                        name: "other"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "SumXY"
      }
      deduced_parameters {
        name: "U"
        type {
          identifier {
            name: "Number"
          }
        }
      }
      param_pattern {
        fields {
          binding_pattern {
            name: "p"
            type {
              expression_pattern {
                expression {
                  call {
                    function {
                      identifier {
                        name: "Point"
                      }
                    }
                    argument {
                      tuple_literal {
                        fields {
                          identifier {
                            name: "U"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      return_term {
        kind: Expression
        type {
          identifier {
            name: "U"
          }
        }
      }
      body {
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  simple_member_access {
                    field: "Add"
                    object {
                      simple_member_access {
                        field: "x"
                        object {
                          call {
                            function {
                              simple_member_access {
                                field: "Origin"
                                object {
                                  identifier {
                                    name: "p"
                                  }
                                }
                              }
                            }
                            argument {
                              tuple_literal {
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      simple_member_access {
                        field: "y"
                        object {
                          identifier {
                            name: "p"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "Main"
      }
      param_pattern {
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "p"
                type {
                  expression_pattern {
                    expression {
                      call {
                        function {
                          identifier {
                            name: "Point"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              int_type_literal {
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
                fields {
                  name: "x"
                  expression {
                    int_literal {
                      value: 0
                    }
                  }
                }
                fields {
                  name: "y"
                  expression {
                    int_literal {
                      value: 0
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  identifier {
                    name: "SumXY"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      identifier {
                        name: "p"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
