259a863ed9082cb8de31b5221b95287d39aed44f 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. function {
  8. name {
  9. name: "DoMul"
  10. }
  11. deduced_parameters {
  12. name: "T"
  13. type {
  14. where {
  15. base {
  16. call {
  17. function {
  18. identifier {
  19. name: "MulWith"
  20. }
  21. }
  22. argument {
  23. tuple_literal {
  24. fields {
  25. designator {
  26. name: "Self"
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }
  33. clauses {
  34. equals {
  35. lhs {
  36. designator {
  37. name: "Result"
  38. }
  39. }
  40. rhs {
  41. designator {
  42. name: "Self"
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50. param_pattern {
  51. fields {
  52. binding_pattern {
  53. name: "x"
  54. type {
  55. expression_pattern {
  56. expression {
  57. identifier {
  58. name: "T"
  59. }
  60. }
  61. }
  62. }
  63. }
  64. }
  65. fields {
  66. binding_pattern {
  67. name: "y"
  68. type {
  69. expression_pattern {
  70. expression {
  71. identifier {
  72. name: "T"
  73. }
  74. }
  75. }
  76. }
  77. }
  78. }
  79. }
  80. return_term {
  81. kind: Expression
  82. type {
  83. identifier {
  84. name: "T"
  85. }
  86. }
  87. }
  88. body {
  89. statements {
  90. return_expression_statement {
  91. expression {
  92. operator {
  93. op: Mul
  94. arguments {
  95. identifier {
  96. name: "x"
  97. }
  98. }
  99. arguments {
  100. identifier {
  101. name: "y"
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. declarations {
  112. function {
  113. name {
  114. name: "Main"
  115. }
  116. param_pattern {
  117. }
  118. return_term {
  119. kind: Expression
  120. type {
  121. int_type_literal {
  122. }
  123. }
  124. }
  125. body {
  126. statements {
  127. return_expression_statement {
  128. expression {
  129. call {
  130. function {
  131. identifier {
  132. name: "DoMul"
  133. }
  134. }
  135. argument {
  136. tuple_literal {
  137. fields {
  138. int_literal {
  139. value: 2
  140. }
  141. }
  142. fields {
  143. int_literal {
  144. value: 3
  145. }
  146. }
  147. }
  148. }
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. }
  156. }