a5cbe60f4b842b38d4daeb66b4f8b8efebe1deb7 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name {
  9. name: "Similar"
  10. }
  11. }
  12. }
  13. declarations {
  14. impl {
  15. kind: InternalImpl
  16. impl_type {
  17. identifier {
  18. name: "T"
  19. }
  20. }
  21. interface {
  22. call {
  23. function {
  24. identifier {
  25. name: "Similar"
  26. }
  27. }
  28. argument {
  29. tuple_literal {
  30. fields {
  31. identifier {
  32. name: "T"
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. declarations {
  42. impl {
  43. kind: InternalImpl
  44. impl_type {
  45. int_type_literal {
  46. }
  47. }
  48. interface {
  49. call {
  50. function {
  51. identifier {
  52. name: "Similar"
  53. }
  54. }
  55. argument {
  56. tuple_literal {
  57. fields {
  58. identifier {
  59. name: "T"
  60. }
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. declarations {
  69. function {
  70. name {
  71. name: "CheckSimilar"
  72. }
  73. deduced_parameters {
  74. name: "T"
  75. type {
  76. type_type_literal {
  77. }
  78. }
  79. }
  80. deduced_parameters {
  81. name: "U"
  82. type {
  83. call {
  84. function {
  85. identifier {
  86. name: "Similar"
  87. }
  88. }
  89. argument {
  90. tuple_literal {
  91. fields {
  92. identifier {
  93. name: "T"
  94. }
  95. }
  96. }
  97. }
  98. }
  99. }
  100. }
  101. param_pattern {
  102. fields {
  103. binding_pattern {
  104. name: "a"
  105. type {
  106. expression_pattern {
  107. expression {
  108. identifier {
  109. name: "T"
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. fields {
  117. binding_pattern {
  118. name: "b"
  119. type {
  120. expression_pattern {
  121. expression {
  122. identifier {
  123. name: "U"
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. return_term {
  132. kind: Omitted
  133. }
  134. body {
  135. }
  136. }
  137. }
  138. declarations {
  139. function {
  140. name {
  141. name: "Main"
  142. }
  143. param_pattern {
  144. }
  145. return_term {
  146. kind: Expression
  147. type {
  148. int_type_literal {
  149. }
  150. }
  151. }
  152. body {
  153. statements {
  154. variable_definition {
  155. pattern {
  156. binding_pattern {
  157. name: "n"
  158. type {
  159. expression_pattern {
  160. expression {
  161. int_type_literal {
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. init {
  169. int_literal {
  170. value: 0
  171. }
  172. }
  173. is_returned: false
  174. }
  175. }
  176. statements {
  177. expression_statement {
  178. expression {
  179. call {
  180. function {
  181. identifier {
  182. name: "CheckSimilar"
  183. }
  184. }
  185. argument {
  186. tuple_literal {
  187. fields {
  188. bool_literal {
  189. value: true
  190. }
  191. }
  192. fields {
  193. bool_literal {
  194. value: false
  195. }
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. }
  203. statements {
  204. expression_statement {
  205. expression {
  206. call {
  207. function {
  208. identifier {
  209. name: "CheckSimilar"
  210. }
  211. }
  212. argument {
  213. tuple_literal {
  214. fields {
  215. bool_literal {
  216. value: true
  217. }
  218. }
  219. fields {
  220. identifier {
  221. name: "n"
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. statements {
  231. return_expression_statement {
  232. expression {
  233. int_literal {
  234. value: 0
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }