ed78839715d8d84e515792b114f227bc6d46029f 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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: "PickType"
  30. }
  31. param_pattern {
  32. fields {
  33. binding_pattern {
  34. name: "N"
  35. type {
  36. expression_pattern {
  37. expression {
  38. int_type_literal {
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. return_term {
  47. kind: Expression
  48. type {
  49. type_type_literal {
  50. }
  51. }
  52. }
  53. body {
  54. statements {
  55. return_expression_statement {
  56. expression {
  57. int_type_literal {
  58. }
  59. }
  60. }
  61. }
  62. }
  63. }
  64. }
  65. declarations {
  66. function {
  67. name {
  68. name: "F"
  69. }
  70. deduced_parameters {
  71. name: "T"
  72. type {
  73. where {
  74. base {
  75. identifier {
  76. name: "Iface"
  77. }
  78. }
  79. clauses {
  80. equals {
  81. lhs {
  82. designator {
  83. name: "N"
  84. }
  85. }
  86. rhs {
  87. int_literal {
  88. value: 5
  89. }
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. param_pattern {
  97. fields {
  98. binding_pattern {
  99. name: "x"
  100. type {
  101. expression_pattern {
  102. expression {
  103. identifier {
  104. name: "T"
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. }
  112. return_term {
  113. kind: Expression
  114. type {
  115. int_type_literal {
  116. }
  117. }
  118. }
  119. body {
  120. statements {
  121. variable_definition {
  122. pattern {
  123. binding_pattern {
  124. name: "x"
  125. type {
  126. expression_pattern {
  127. expression {
  128. call {
  129. function {
  130. identifier {
  131. name: "PickType"
  132. }
  133. }
  134. argument {
  135. tuple_literal {
  136. fields {
  137. simple_member_access {
  138. field: "N"
  139. object {
  140. identifier {
  141. name: "T"
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }
  150. }
  151. }
  152. }
  153. }
  154. init {
  155. int_literal {
  156. value: 0
  157. }
  158. }
  159. is_returned: false
  160. }
  161. }
  162. statements {
  163. return_expression_statement {
  164. expression {
  165. identifier {
  166. name: "x"
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. declarations {
  175. impl {
  176. kind: InternalImpl
  177. impl_type {
  178. int_type_literal {
  179. }
  180. }
  181. interface {
  182. where {
  183. base {
  184. identifier {
  185. name: "Iface"
  186. }
  187. }
  188. clauses {
  189. equals {
  190. lhs {
  191. designator {
  192. name: "N"
  193. }
  194. }
  195. rhs {
  196. int_literal {
  197. value: 5
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. declarations {
  207. function {
  208. name {
  209. name: "Main"
  210. }
  211. param_pattern {
  212. }
  213. return_term {
  214. kind: Expression
  215. type {
  216. int_type_literal {
  217. }
  218. }
  219. }
  220. body {
  221. statements {
  222. return_expression_statement {
  223. expression {
  224. call {
  225. function {
  226. identifier {
  227. name: "F"
  228. }
  229. }
  230. argument {
  231. tuple_literal {
  232. fields {
  233. int_literal {
  234. value: 0
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. }
  246. }