0b8c017e8d7d8b363cb3d80dbfa45a8f917748e9 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name {
  9. name: "Iface"
  10. }
  11. members {
  12. let {
  13. pattern {
  14. generic_binding {
  15. name: "N"
  16. type {
  17. int_type_literal {
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. declarations {
  27. function {
  28. name {
  29. name: "F"
  30. }
  31. param_pattern {
  32. fields {
  33. generic_binding {
  34. name: "T"
  35. type {
  36. where {
  37. base {
  38. identifier {
  39. name: "Iface"
  40. }
  41. }
  42. clauses {
  43. equals {
  44. lhs {
  45. designator {
  46. name: "N"
  47. }
  48. }
  49. rhs {
  50. int_literal {
  51. value: 5
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. }
  60. }
  61. return_term {
  62. kind: Omitted
  63. }
  64. body {
  65. }
  66. }
  67. }
  68. declarations {
  69. class_declaration {
  70. name {
  71. name: "Good"
  72. }
  73. }
  74. }
  75. declarations {
  76. class_declaration {
  77. name {
  78. name: "Bad"
  79. }
  80. }
  81. }
  82. declarations {
  83. impl {
  84. kind: ExternalImpl
  85. impl_type {
  86. identifier {
  87. name: "Good"
  88. }
  89. }
  90. interface {
  91. where {
  92. base {
  93. identifier {
  94. name: "Iface"
  95. }
  96. }
  97. clauses {
  98. rewrite {
  99. member_name: "N"
  100. replacement {
  101. int_literal {
  102. value: 5
  103. }
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. declarations {
  112. impl {
  113. kind: ExternalImpl
  114. impl_type {
  115. identifier {
  116. name: "Bad"
  117. }
  118. }
  119. interface {
  120. where {
  121. base {
  122. identifier {
  123. name: "Iface"
  124. }
  125. }
  126. clauses {
  127. rewrite {
  128. member_name: "N"
  129. replacement {
  130. int_literal {
  131. value: 4
  132. }
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. declarations {
  141. function {
  142. name {
  143. name: "Main"
  144. }
  145. param_pattern {
  146. }
  147. return_term {
  148. kind: Expression
  149. type {
  150. int_type_literal {
  151. }
  152. }
  153. }
  154. body {
  155. statements {
  156. expression_statement {
  157. expression {
  158. call {
  159. function {
  160. identifier {
  161. name: "F"
  162. }
  163. }
  164. argument {
  165. tuple_literal {
  166. fields {
  167. identifier {
  168. name: "Good"
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. statements {
  178. expression_statement {
  179. expression {
  180. call {
  181. function {
  182. identifier {
  183. name: "F"
  184. }
  185. }
  186. argument {
  187. tuple_literal {
  188. fields {
  189. identifier {
  190. name: "Bad"
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. }
  199. statements {
  200. return_expression_statement {
  201. expression {
  202. int_literal {
  203. value: 0
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. }
  211. }