compilation_unit {
  package_statement {
    package_name: "ExplorerTest"
  }
  is_api: true
  declarations {
    interface {
      name {
        name: "A"
      }
      members {
        let {
          pattern {
            generic_binding {
              name: "TA"
              type {
                type_type_literal {
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "FA"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "TA"
              }
            }
          }
        }
      }
    }
  }
  declarations {
    interface {
      name {
        name: "B"
      }
      members {
        let {
          pattern {
            generic_binding {
              name: "TB"
              type {
                type_type_literal {
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "FB"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              identifier {
                name: "TB"
              }
            }
          }
        }
      }
    }
  }
  declarations {
    class_declaration {
      name {
        name: "C"
      }
      members {
        impl {
          kind: InternalImpl
          impl_type {
            identifier {
              name: "Self"
            }
          }
          interface {
            where {
              base {
                operator {
                  op: BitwiseAnd
                  arguments {
                    identifier {
                      name: "A"
                    }
                  }
                  arguments {
                    identifier {
                      name: "B"
                    }
                  }
                }
              }
              clauses {
                rewrite {
                  member_name: "TA"
                  replacement {
                    int_type_literal {
                    }
                  }
                }
              }
              clauses {
                rewrite {
                  member_name: "TB"
                  replacement {
                    int_type_literal {
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name {
                name: "FA"
              }
              param_pattern {
              }
              return_term {
                kind: Expression
                type {
                  int_type_literal {
                  }
                }
              }
              body {
                statements {
                  variable_definition {
                    pattern {
                      binding_pattern {
                        name: "v"
                        type {
                          expression_pattern {
                            expression {
                              compound_member_access {
                                object {
                                  identifier {
                                    name: "Self"
                                  }
                                }
                                path {
                                  simple_member_access {
                                    field: "TA"
                                    object {
                                      identifier {
                                        name: "A"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                    init {
                      int_literal {
                        value: 1
                      }
                    }
                    is_returned: false
                  }
                }
                statements {
                  variable_definition {
                    pattern {
                      binding_pattern {
                        name: "w"
                        type {
                          expression_pattern {
                            expression {
                              int_type_literal {
                              }
                            }
                          }
                        }
                      }
                    }
                    init {
                      identifier {
                        name: "v"
                      }
                    }
                    is_returned: false
                  }
                }
                statements {
                  return_expression_statement {
                    expression {
                      identifier {
                        name: "w"
                      }
                    }
                  }
                }
              }
            }
          }
          members {
            function {
              name {
                name: "FB"
              }
              param_pattern {
              }
              return_term {
                kind: Expression
                type {
                  int_type_literal {
                  }
                }
              }
              body {
                statements {
                  variable_definition {
                    pattern {
                      binding_pattern {
                        name: "v"
                        type {
                          expression_pattern {
                            expression {
                              compound_member_access {
                                object {
                                  identifier {
                                    name: "Self"
                                  }
                                }
                                path {
                                  simple_member_access {
                                    field: "TB"
                                    object {
                                      identifier {
                                        name: "B"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                    init {
                      int_literal {
                        value: 2
                      }
                    }
                    is_returned: false
                  }
                }
                statements {
                  variable_definition {
                    pattern {
                      binding_pattern {
                        name: "w"
                        type {
                          expression_pattern {
                            expression {
                              compound_member_access {
                                object {
                                  identifier {
                                    name: "Self"
                                  }
                                }
                                path {
                                  simple_member_access {
                                    field: "TA"
                                    object {
                                      identifier {
                                        name: "A"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                    init {
                      int_literal {
                        value: 3
                      }
                    }
                    is_returned: false
                  }
                }
                statements {
                  return_expression_statement {
                    expression {
                      operator {
                        op: Add
                        arguments {
                          identifier {
                            name: "v"
                          }
                        }
                        arguments {
                          identifier {
                            name: "w"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      type_params {
        fields {
          generic_binding {
            name: "T"
            type {
              type_type_literal {
              }
            }
          }
        }
      }
    }
  }
  declarations {
    impl {
      kind: ExternalImpl
      impl_type {
        call {
          function {
            identifier {
              name: "C"
            }
          }
          argument {
            tuple_literal {
              fields {
                int_type_literal {
                }
              }
            }
          }
        }
      }
      interface {
        where {
          base {
            identifier {
              name: "B"
            }
          }
          clauses {
            equals {
              lhs {
                designator {
                  name: "TB"
                }
              }
              rhs {
                tuple_literal {
                }
              }
            }
          }
        }
      }
      members {
        function {
          name {
            name: "FB"
          }
          param_pattern {
          }
          return_term {
            kind: Expression
            type {
              tuple_literal {
              }
            }
          }
          body {
            statements {
              return_expression_statement {
                expression {
                  tuple_literal {
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  declarations {
    function {
      name {
        name: "Main"
      }
      param_pattern {
      }
      return_term {
        kind: Expression
        type {
          int_type_literal {
          }
        }
      }
      body {
        statements {
          return_expression_statement {
            expression {
              call {
                function {
                  simple_member_access {
                    field: "FB"
                    object {
                      call {
                        function {
                          identifier {
                            name: "C"
                          }
                        }
                        argument {
                          tuple_literal {
                            fields {
                              int_type_literal {
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                argument {
                  tuple_literal {
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
