compilation_unit {
  package_statement {
    package_name: "ExplorerTest"
  }
  is_api: true
  declarations {
    interface {
      name: "Vector"
      members {
        function {
          name: "Zero"
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "Self"
              }
            }
          }
        }
      }
      members {
        function {
          name: "Add"
          me_pattern {
            binding_pattern {
              name: "me"
              type {
                expression_pattern {
                  expression {
                    identifier {
                      name: "Self"
                    }
                  }
                }
              }
            }
          }
          param_pattern {
            fields {
              binding_pattern {
                name: "b"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "Self"
                      }
                    }
                  }
                }
              }
            }
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "Self"
              }
            }
          }
        }
      }
      members {
        function {
          name: "Scale"
          me_pattern {
            binding_pattern {
              name: "me"
              type {
                expression_pattern {
                  expression {
                    identifier {
                      name: "Self"
                    }
                  }
                }
              }
            }
          }
          param_pattern {
            fields {
              binding_pattern {
                name: "v"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "Scalar"
                      }
                    }
                  }
                }
              }
            }
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "Self"
              }
            }
          }
        }
      }
      self {
        name: "Self"
        type {
          type_type_literal {
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name: "Point"
      members {
        variable {
          binding {
            name: "x"
            type {
              expression_pattern {
                expression {
                  int_type_literal {
                  }
                }
              }
            }
          }
        }
      }
      members {
        variable {
          binding {
            name: "y"
            type {
              expression_pattern {
                expression {
                  int_type_literal {
                  }
                }
              }
            }
          }
        }
      }
      members {
        impl {
          kind: InternalImpl
          impl_type {
            identifier {
              name: "Point"
            }
          }
          interface {
            call {
              function {
                identifier {
                  name: "Vector"
                }
              }
              argument {
                tuple_literal {
                  fields {
                    int_type_literal {
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name: "Zero"
              param_pattern {
              }
              return_term {
                kind: Expression
                type {
                  identifier {
                    name: "Point"
                  }
                }
              }
              body {
                statements {
                  return_expression_statement {
                    expression {
                      struct_literal {
                        fields {
                          name: "x"
                          expression {
                            int_literal {
                              value: 0
                            }
                          }
                        }
                        fields {
                          name: "y"
                          expression {
                            int_literal {
                              value: 0
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name: "Add"
              me_pattern {
                binding_pattern {
                  name: "me"
                  type {
                    expression_pattern {
                      expression {
                        identifier {
                          name: "Point"
                        }
                      }
                    }
                  }
                }
              }
              param_pattern {
                fields {
                  binding_pattern {
                    name: "b"
                    type {
                      expression_pattern {
                        expression {
                          identifier {
                            name: "Point"
                          }
                        }
                      }
                    }
                  }
                }
              }
              return_term {
                kind: Expression
                type {
                  identifier {
                    name: "Point"
                  }
                }
              }
              body {
                statements {
                  return_expression_statement {
                    expression {
                      struct_literal {
                        fields {
                          name: "x"
                          expression {
                            operator {
                              op: Add
                              arguments {
                                simple_member_access {
                                  field: "x"
                                  object {
                                    identifier {
                                      name: "me"
                                    }
                                  }
                                }
                              }
                              arguments {
                                simple_member_access {
                                  field: "x"
                                  object {
                                    identifier {
                                      name: "b"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                        fields {
                          name: "y"
                          expression {
                            operator {
                              op: Add
                              arguments {
                                simple_member_access {
                                  field: "y"
                                  object {
                                    identifier {
                                      name: "me"
                                    }
                                  }
                                }
                              }
                              arguments {
                                simple_member_access {
                                  field: "y"
                                  object {
                                    identifier {
                                      name: "b"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name: "Scale"
              me_pattern {
                binding_pattern {
                  name: "me"
                  type {
                    expression_pattern {
                      expression {
                        identifier {
                          name: "Point"
                        }
                      }
                    }
                  }
                }
              }
              param_pattern {
                fields {
                  binding_pattern {
                    name: "v"
                    type {
                      expression_pattern {
                        expression {
                          int_type_literal {
                          }
                        }
                      }
                    }
                  }
                }
              }
              return_term {
                kind: Expression
                type {
                  identifier {
                    name: "Point"
                  }
                }
              }
              body {
                statements {
                  return_expression_statement {
                    expression {
                      struct_literal {
                        fields {
                          name: "x"
                          expression {
                            operator {
                              op: Mul
                              arguments {
                                simple_member_access {
                                  field: "x"
                                  object {
                                    identifier {
                                      name: "me"
                                    }
                                  }
                                }
                              }
                              arguments {
                                identifier {
                                  name: "v"
                                }
                              }
                            }
                          }
                        }
                        fields {
                          name: "y"
                          expression {
                            operator {
                              op: Mul
                              arguments {
                                simple_member_access {
                                  field: "y"
                                  object {
                                    identifier {
                                      name: "me"
                                    }
                                  }
                                }
                              }
                              arguments {
                                identifier {
                                  name: "v"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name: "AddAndScaleGeneric"
      deduced_parameters {
        name: "T"
        type {
          type_type_literal {
          }
        }
      }
      deduced_parameters {
        name: "U"
        type {
          call {
            function {
              identifier {
                name: "Vector"
              }
            }
            argument {
              tuple_literal {
                fields {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      param_pattern {
        fields {
          binding_pattern {
            name: "a"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "U"
                  }
                }
              }
            }
          }
        }
        fields {
          binding_pattern {
            name: "s"
            type {
              expression_pattern {
                expression {
                  identifier {
                    name: "T"
                  }
                }
              }
            }
          }
        }
      }
      return_term {
        kind: Expression
        type {
          identifier {
            name: "U"
          }
        }
      }
      body {
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  simple_member_access {
                    field: "Scale"
                    object {
                      call {
                        function {
                          simple_member_access {
                            field: "Add"
                            object {
                              identifier {
                                name: "a"
                              }
                            }
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              call {
                                function {
                                  simple_member_access {
                                    field: "Zero"
                                    object {
                                      identifier {
                                        name: "U"
                                      }
                                    }
                                  }
                                }
                                argument {
                                  tuple_literal {
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      identifier {
                        name: "s"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name: "Main"
      param_pattern {
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "a"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "Point"
                      }
                    }
                  }
                }
              }
            }
            init {
              struct_literal {
                fields {
                  name: "x"
                  expression {
                    int_literal {
                      value: 2
                    }
                  }
                }
                fields {
                  name: "y"
                  expression {
                    int_literal {
                      value: 1
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          variable_definition {
            pattern {
              binding_pattern {
                name: "p"
                type {
                  expression_pattern {
                    expression {
                      identifier {
                        name: "Point"
                      }
                    }
                  }
                }
              }
            }
            init {
              call {
                function {
                  identifier {
                    name: "AddAndScaleGeneric"
                  }
                }
                argument {
                  tuple_literal {
                    fields {
                      identifier {
                        name: "a"
                      }
                    }
                    fields {
                      int_literal {
                        value: 5
                      }
                    }
                  }
                }
              }
            }
            is_returned: false
          }
        }
        statements {
          return_expression_statement {
            expression {
              operator {
                op: Sub
                arguments {
                  simple_member_access {
                    field: "x"
                    object {
                      identifier {
                        name: "p"
                      }
                    }
                  }
                }
                arguments {
                  int_literal {
                    value: 10
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
