2b2f010551966d603bef56c3e3e7cb35c1937bf7 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name: "A"
  9. members {
  10. function {
  11. name: "F"
  12. param_pattern {
  13. }
  14. return_term {
  15. kind: Expression
  16. type {
  17. int_type_literal {
  18. }
  19. }
  20. }
  21. }
  22. }
  23. self {
  24. name: "Self"
  25. type {
  26. type_type_literal {
  27. }
  28. }
  29. }
  30. }
  31. }
  32. declarations {
  33. interface {
  34. name: "B"
  35. members {
  36. function {
  37. name: "F"
  38. param_pattern {
  39. }
  40. return_term {
  41. kind: Expression
  42. type {
  43. int_type_literal {
  44. }
  45. }
  46. }
  47. }
  48. }
  49. self {
  50. name: "Self"
  51. type {
  52. type_type_literal {
  53. }
  54. }
  55. }
  56. }
  57. }
  58. declarations {
  59. impl {
  60. kind: InternalImpl
  61. impl_type {
  62. int_type_literal {
  63. }
  64. }
  65. interface {
  66. identifier {
  67. name: "A"
  68. }
  69. }
  70. members {
  71. function {
  72. name: "F"
  73. param_pattern {
  74. }
  75. return_term {
  76. kind: Expression
  77. type {
  78. int_type_literal {
  79. }
  80. }
  81. }
  82. body {
  83. statements {
  84. return_expression_statement {
  85. expression {
  86. int_literal {
  87. value: 1
  88. }
  89. }
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. }
  97. declarations {
  98. impl {
  99. kind: InternalImpl
  100. impl_type {
  101. int_type_literal {
  102. }
  103. }
  104. interface {
  105. identifier {
  106. name: "B"
  107. }
  108. }
  109. members {
  110. function {
  111. name: "F"
  112. param_pattern {
  113. }
  114. return_term {
  115. kind: Expression
  116. type {
  117. int_type_literal {
  118. }
  119. }
  120. }
  121. body {
  122. statements {
  123. return_expression_statement {
  124. expression {
  125. int_literal {
  126. value: 2
  127. }
  128. }
  129. }
  130. }
  131. }
  132. }
  133. }
  134. }
  135. }
  136. declarations {
  137. function {
  138. name: "GetAB"
  139. param_pattern {
  140. fields {
  141. generic_binding {
  142. name: "T"
  143. type {
  144. where {
  145. base {
  146. identifier {
  147. name: "B"
  148. }
  149. }
  150. clauses {
  151. is {
  152. type {
  153. designator {
  154. name: "Self"
  155. }
  156. }
  157. constraint {
  158. identifier {
  159. name: "A"
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. return_term {
  170. kind: Expression
  171. type {
  172. int_type_literal {
  173. }
  174. }
  175. }
  176. body {
  177. statements {
  178. return_expression_statement {
  179. expression {
  180. operator {
  181. op: Add
  182. arguments {
  183. operator {
  184. op: Add
  185. arguments {
  186. operator {
  187. op: Mul
  188. arguments {
  189. int_literal {
  190. value: 100
  191. }
  192. }
  193. arguments {
  194. call {
  195. function {
  196. compound_member_access {
  197. object {
  198. identifier {
  199. name: "T"
  200. }
  201. }
  202. path {
  203. simple_member_access {
  204. field: "F"
  205. object {
  206. identifier {
  207. name: "A"
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. argument {
  215. tuple_literal {
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. arguments {
  223. operator {
  224. op: Mul
  225. arguments {
  226. int_literal {
  227. value: 10
  228. }
  229. }
  230. arguments {
  231. call {
  232. function {
  233. compound_member_access {
  234. object {
  235. identifier {
  236. name: "T"
  237. }
  238. }
  239. path {
  240. simple_member_access {
  241. field: "F"
  242. object {
  243. identifier {
  244. name: "B"
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. argument {
  252. tuple_literal {
  253. }
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. arguments {
  262. call {
  263. function {
  264. simple_member_access {
  265. field: "F"
  266. object {
  267. identifier {
  268. name: "T"
  269. }
  270. }
  271. }
  272. }
  273. argument {
  274. tuple_literal {
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. }
  286. declarations {
  287. function {
  288. name: "Main"
  289. param_pattern {
  290. }
  291. return_term {
  292. kind: Expression
  293. type {
  294. int_type_literal {
  295. }
  296. }
  297. }
  298. body {
  299. statements {
  300. return_expression_statement {
  301. expression {
  302. call {
  303. function {
  304. identifier {
  305. name: "GetAB"
  306. }
  307. }
  308. argument {
  309. tuple_literal {
  310. fields {
  311. int_type_literal {
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }