947944c011b708642cc80e31b42d0ba3d38426a7 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. compilation_unit {
  2. package_statement {
  3. package_name: "Testcase"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name {
  9. name: "HasName"
  10. }
  11. members {
  12. let {
  13. pattern {
  14. generic_binding {
  15. name: "Name"
  16. type {
  17. string_type_literal {
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. declarations {
  27. impl {
  28. kind: ExternalImpl
  29. impl_type {
  30. int_type_literal {
  31. }
  32. }
  33. interface {
  34. where {
  35. base {
  36. identifier {
  37. name: "HasName"
  38. }
  39. }
  40. clauses {
  41. rewrite {
  42. member_name: "Name"
  43. replacement {
  44. string_literal {
  45. value: "i32"
  46. }
  47. }
  48. }
  49. }
  50. }
  51. }
  52. }
  53. }
  54. declarations {
  55. impl {
  56. kind: ExternalImpl
  57. impl_type {
  58. string_type_literal {
  59. }
  60. }
  61. interface {
  62. where {
  63. base {
  64. identifier {
  65. name: "HasName"
  66. }
  67. }
  68. clauses {
  69. rewrite {
  70. member_name: "Name"
  71. replacement {
  72. string_literal {
  73. value: "String"
  74. }
  75. }
  76. }
  77. }
  78. }
  79. }
  80. }
  81. }
  82. declarations {
  83. function {
  84. name {
  85. name: "Main"
  86. }
  87. param_pattern {
  88. }
  89. return_term {
  90. kind: Expression
  91. type {
  92. int_type_literal {
  93. }
  94. }
  95. }
  96. body {
  97. statements {
  98. expression_statement {
  99. expression {
  100. call {
  101. function {
  102. identifier {
  103. name: "Print"
  104. }
  105. }
  106. argument {
  107. tuple_literal {
  108. fields {
  109. compound_member_access {
  110. object {
  111. int_type_literal {
  112. }
  113. }
  114. path {
  115. simple_member_access {
  116. field: "Name"
  117. object {
  118. identifier {
  119. name: "HasName"
  120. }
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. statements {
  133. expression_statement {
  134. expression {
  135. call {
  136. function {
  137. identifier {
  138. name: "Print"
  139. }
  140. }
  141. argument {
  142. tuple_literal {
  143. fields {
  144. compound_member_access {
  145. object {
  146. string_type_literal {
  147. }
  148. }
  149. path {
  150. simple_member_access {
  151. field: "Name"
  152. object {
  153. identifier {
  154. name: "HasName"
  155. }
  156. }
  157. }
  158. }
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. }
  167. statements {
  168. return_expression_statement {
  169. expression {
  170. int_literal {
  171. value: 0
  172. }
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }