33cbf93a6a8b2aa19fb8a569080a77ce55bc85a2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. compilation_unit {
  2. package_statement {
  3. package_name: "Foo"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name: "HasDefault"
  9. members {
  10. function {
  11. name: "Default"
  12. param_pattern {
  13. }
  14. return_term {
  15. kind: Expression
  16. type {
  17. identifier {
  18. name: "Self"
  19. }
  20. }
  21. }
  22. }
  23. }
  24. self {
  25. name: "Self"
  26. type {
  27. type_type_literal {
  28. }
  29. }
  30. }
  31. }
  32. }
  33. declarations {
  34. impl {
  35. kind: InternalImpl
  36. impl_type {
  37. int_type_literal {
  38. }
  39. }
  40. interface {
  41. identifier {
  42. name: "HasDefault"
  43. }
  44. }
  45. members {
  46. function {
  47. name: "Default"
  48. param_pattern {
  49. }
  50. return_term {
  51. kind: Expression
  52. type {
  53. int_type_literal {
  54. }
  55. }
  56. }
  57. body {
  58. statements {
  59. return_statement {
  60. expression {
  61. int_literal {
  62. value: 42
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72. declarations {
  73. function {
  74. name: "Main"
  75. param_pattern {
  76. }
  77. return_term {
  78. kind: Expression
  79. type {
  80. int_type_literal {
  81. }
  82. }
  83. }
  84. body {
  85. statements {
  86. return_statement {
  87. expression {
  88. call {
  89. function {
  90. compound_member_access {
  91. object {
  92. int_type_literal {
  93. }
  94. }
  95. path {
  96. simple_member_access {
  97. field: "Default"
  98. object {
  99. identifier {
  100. name: "HasDefault"
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. argument {
  108. tuple_literal {
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }