Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

*boxContext => *box.Context , *boxMacro => *box.Macro

Performs the following renamings:
* scala.reflect.macros.BlackboxContext to scala.reflect.macros.blackbox.Context
* scala.reflect.macros.BlackboxMacro to scala.reflect.macros.blackbox.Macro
* scala.reflect.macros.WhiteboxContext to scala.reflect.macros.whitebox.Context
* scala.reflect.macros.WhiteboxMacro to scala.reflect.macros.whitebox.Macro

https://groups.google.com/forum/#!topic/scala-internals/MX40-dM28rk
  • Loading branch information...
commit 5cc8f83c681ded7367dc5112f6f9042e9526facf 1 parent e089caf
@xeno-by xeno-by authored
Showing with 760 additions and 748 deletions.
  1. +1 −1  src/compiler/scala/reflect/macros/compiler/Errors.scala
  2. +2 −2 src/compiler/scala/reflect/macros/compiler/Resolvers.scala
  3. +6 −6 src/compiler/scala/reflect/macros/compiler/Validators.scala
  4. +2 −2 src/compiler/scala/reflect/macros/contexts/Context.scala
  5. +1 −1  src/compiler/scala/tools/nsc/typechecker/Implicits.scala
  6. +8 −8 src/compiler/scala/tools/nsc/typechecker/Macros.scala
  7. +2 −2 src/partest-extras/scala/tools/partest/Util.scala
  8. +1 −1  src/reflect/scala/reflect/api/Exprs.scala
  9. +1 −1  src/reflect/scala/reflect/api/Importers.scala
  10. +3 −3 src/reflect/scala/reflect/api/Mirrors.scala
  11. +3 −3 src/reflect/scala/reflect/api/Universe.scala
  12. +4 −4 src/reflect/scala/reflect/internal/Definitions.scala
  13. +2 −2 src/reflect/scala/reflect/macros/Aliases.scala
  14. +3 −3 src/reflect/scala/reflect/macros/Enclosures.scala
  15. +4 −4 src/reflect/scala/reflect/macros/Evals.scala
  16. +2 −2 src/reflect/scala/reflect/macros/ExprUtils.scala
  17. +2 −2 src/reflect/scala/reflect/macros/FrontEnds.scala
  18. +2 −2 src/reflect/scala/reflect/macros/Infrastructure.scala
  19. +2 −2 src/reflect/scala/reflect/macros/Names.scala
  20. +2 −2 src/reflect/scala/reflect/macros/Parsers.scala
  21. +2 −2 src/reflect/scala/reflect/macros/Reifiers.scala
  22. +3 −3 src/reflect/scala/reflect/macros/Typers.scala
  23. +15 −14 src/reflect/scala/reflect/macros/{BlackboxContext.scala → blackbox/Context.scala}
  24. +11 −7 src/reflect/scala/reflect/macros/{BlackboxMacro.scala → blackbox/Macro.scala}
  25. +4 −4 src/reflect/scala/reflect/macros/package.scala
  26. +7 −6 src/reflect/scala/reflect/macros/{WhiteboxContext.scala → whitebox/Context.scala}
  27. +11 −7 src/reflect/scala/reflect/macros/{WhiteboxMacro.scala → whitebox/Macro.scala}
  28. +1 −1  src/reflect/scala/reflect/runtime/package.scala
  29. +2 −2 test/files/neg/macro-abort/Macros_1.scala
  30. +4 −4 test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala
  31. +2 −2 test/files/neg/macro-blackbox-dynamic-materialization/Macros_1.scala
  32. +2 −2 test/files/neg/macro-blackbox-extractor/Macros_1.scala
  33. +2 −2 test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala
  34. +1 −1  test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala
  35. +1 −1  test/files/neg/macro-bundle-abstract.check
  36. +2 −2 test/files/neg/macro-bundle-abstract.scala
  37. +1 −1  test/files/neg/macro-bundle-class.check
  38. +2 −3 test/files/neg/macro-bundle-class.scala
  39. +1 −1  test/files/neg/macro-bundle-mixbox.check
  40. +2 −1  test/files/neg/macro-bundle-mixbox.scala
  41. +2 −2 test/files/neg/macro-bundle-object.check
  42. +3 −3 test/files/neg/macro-bundle-object.scala
  43. +3 −3 test/files/neg/macro-bundle-polymorphic.check
  44. +2 −2 test/files/neg/macro-bundle-polymorphic.scala
  45. +1 −1  test/files/neg/macro-bundle-trait.check
  46. +3 −4 test/files/neg/macro-bundle-trait.scala
  47. +2 −2 test/files/neg/macro-cyclic/Impls_Macros_1.scala
  48. +2 −2 test/files/neg/macro-divergence-controlled/Impls_Macros_1.scala
  49. +2 −2 test/files/neg/macro-exception/Macros_1.scala
  50. +2 −2 test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala
  51. +2 −2 test/files/neg/macro-incompatible-macro-engine/Macros_2.scala
  52. +10 −10 test/files/neg/macro-invalidimpl.check
  53. +10 −10 test/files/neg/macro-invalidimpl/Impls_1.scala
  54. +2 −2 test/files/neg/macro-invalidimpl/Macros_Test_2.scala
  55. +6 −6 test/files/neg/macro-invalidret.check
  56. +6 −6 test/files/neg/macro-invalidret/Impls_1.scala
  57. +2 −2 test/files/neg/macro-invalidshape/Impls_1.scala
  58. +1 −1  test/files/neg/macro-invalidshape/Macros_Test_2.scala
  59. +3 −3 test/files/neg/macro-invalidsig-params-badtype.check
  60. +2 −2 test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala
  61. +29 −29 test/files/neg/macro-invalidsig.check
  62. +15 −15 test/files/neg/macro-invalidsig/Impls_1.scala
  63. +2 −2 test/files/neg/macro-invalidusage-badargs/Impls_1.scala
  64. +2 −2 test/files/neg/macro-invalidusage-badbounds/Impls_1.scala
  65. +2 −2 test/files/neg/macro-invalidusage-badtargs/Impls_1.scala
  66. +2 −2 test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala
  67. +2 −2 test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala
  68. +2 −2 test/files/neg/macro-invalidusage-presuper/Impls_1.scala
  69. +2 −2 test/files/neg/macro-noexpand/Impls_1.scala
  70. +2 −2 test/files/neg/macro-nontypeablebody/Impls_1.scala
  71. +2 −2 test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala
  72. +2 −2 test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala
  73. +6 −6 test/files/neg/macro-override-method-overrides-macro/Impls_1.scala
  74. +2 −2 test/files/neg/macro-quasiquotes/Macros_1.scala
  75. +2 −2 test/files/neg/macro-reify-splice-splice/Macros_1.scala
  76. +4 −4 test/files/neg/macro-without-xmacros-a/Impls_1.scala
  77. +4 −4 test/files/neg/macro-without-xmacros-b/Impls_1.scala
  78. +3 −3 test/files/neg/t5689.check
  79. +2 −2 test/files/neg/t5689.scala
  80. +2 −2 test/files/neg/t5753/Impls_Macros_1.scala
  81. +1 −1  test/files/neg/t5753/Test_2.scala
  82. +2 −2 test/files/neg/t5903a/Macros_1.scala
  83. +2 −2 test/files/neg/t5903b/Macros_1.scala
  84. +2 −2 test/files/neg/t5903c/Macros_1.scala
  85. +2 −2 test/files/neg/t5903d/Macros_1.scala
  86. +2 −2 test/files/neg/t5903e/Macros_1.scala
  87. +3 −3 test/files/neg/t6123-explaintypes-macros.check
  88. +2 −2 test/files/neg/t6123-explaintypes-macros/BadMac_2.scala
  89. +2 −2 test/files/neg/t6123-explaintypes-macros/Macros.scala
  90. +2 −2 test/files/neg/t6539/Macro_1.scala
  91. +13 −13 test/files/neg/t7157/Impls_Macros_1.scala
  92. +2 −2 test/files/neg/t8104/Macros_1.scala
  93. +2 −2 test/files/pos/annotated-original/M_1.scala
  94. +2 −2 test/files/pos/annotated-treecopy/Impls_Macros_1.scala
  95. +2 −2 test/files/pos/attachments-typed-another-ident/Impls_1.scala
  96. +2 −2 test/files/pos/attachments-typed-ident/Impls_1.scala
  97. +1 −1  test/files/pos/macro-implicit-invalidate-on-error.scala
  98. +2 −2 test/files/pos/t5692a/Macros_1.scala
  99. +2 −2 test/files/pos/t5692b/Macros_1.scala
  100. +2 −2 test/files/pos/t5706.scala
  101. +3 −3 test/files/pos/t5744/Macros_1.scala
  102. +2 −2 test/files/pos/t6047.scala
  103. +4 −4 test/files/pos/t6447.scala
  104. +2 −2 test/files/pos/t6485a/Macros_1.scala
  105. +2 −2 test/files/pos/t6485b/Test.scala
  106. +3 −3 test/files/pos/t6516.scala
  107. +2 −2 test/files/pos/t7377/Macro_1.scala
  108. +2 −2 test/files/pos/t7461/Macros_1.scala
  109. +1 −1  test/files/pos/t7649.scala
  110. +1 −1  test/files/pos/t7776.scala
  111. +2 −2 test/files/pos/t8001/Macros_1.scala
  112. +1 −1  test/files/pos/t8013/inpervolator_1.scala
  113. +1 −1  test/files/pos/t8064/Macro_1.scala
  114. +1 −1  test/files/pos/t8064b/Macro_1.scala
  115. +2 −2 test/files/run/macro-abort-fresh/Macros_1.scala
  116. +2 −2 test/files/run/macro-auto-duplicate/Macros_1.scala
  117. +4 −4 test/files/run/macro-basic-ma-md-mi/Impls_1.scala
  118. +4 −4 test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala
  119. +4 −4 test/files/run/macro-basic-mamd-mi/Impls_1.scala
  120. +2 −2 test/files/run/macro-blackbox-materialization/Macros_1.scala
  121. +2 −1  test/files/run/macro-bodyexpandstoimpl/Impls_1.scala
  122. +4 −4 test/files/run/macro-bundle-repl.check
  123. +3 −3 test/files/run/macro-bundle-repl.scala
  124. +3 −3 test/files/run/macro-bundle-static/Impls_Macros_1.scala
  125. +3 −3 test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala
  126. +2 −2 test/files/run/macro-def-path-dependent/Test_1.scala
  127. +2 −2 test/files/run/macro-def-path-dependent/Test_2.scala
  128. +2 −2 test/files/run/macro-def-path-dependent/Test_3.scala
  129. +2 −2 test/files/run/macro-def-path-dependent/Test_4.scala
  130. +2 −2 test/files/run/macro-def-path-dependent/Test_5.scala
  131. +1 −1  test/files/run/macro-def-path-dependent/Test_6.scala
  132. +2 −2 test/files/run/macro-default-params/Macros_1.scala
  133. +2 −2 test/files/run/macro-divergence-spurious/Impls_Macros_1.scala
  134. +2 −2 test/files/run/macro-duplicate/Impls_Macros_1.scala
  135. +2 −2 test/files/run/macro-enclosures/Impls_Macros_1.scala
  136. +2 −2 test/files/run/macro-expand-implicit-argument/Macros_1.scala
  137. +2 −2 test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
  138. +2 −2 test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala
  139. +2 −2 test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala
  140. +2 −2 test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala
  141. +2 −2 test/files/run/macro-expand-multiple-arglists/Impls_1.scala
  142. +6 −6 test/files/run/macro-expand-nullary-generic/Impls_1.scala
  143. +6 −6 test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
  144. +6 −6 test/files/run/macro-expand-overload/Impls_1.scala
  145. +6 −6 test/files/run/macro-expand-override/Impls_1.scala
  146. +3 −3 test/files/run/macro-expand-recursive/Impls_1.scala
  147. +3 −3 test/files/run/macro-expand-tparams-bounds/Impls_1.scala
  148. +2 −2 test/files/run/macro-expand-tparams-explicit/Impls_1.scala
  149. +2 −2 test/files/run/macro-expand-tparams-implicit/Impls_1.scala
  150. +4 −4 test/files/run/macro-expand-tparams-prefix/Impls_1.scala
  151. +2 −2 test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala
  152. +2 −2 test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala
  153. +2 −2 test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala
  154. +2 −2 test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala
  155. +2 −2 test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala
  156. +2 −2 test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala
  157. +2 −2 test/files/run/macro-impl-default-params/Impls_Macros_1.scala
  158. +5 −5 test/files/run/macro-impl-relaxed/Macros_1.scala
  159. +2 −2 test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
  160. +2 −2 test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala
  161. +2 −2 test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala
  162. +2 −2 test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
  163. +2 −2 test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
  164. +2 −2 test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala
  165. +2 −2 test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
  166. +2 −2 test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala
  167. +2 −2 test/files/run/macro-openmacros/Impls_Macros_1.scala
  168. +3 −2 test/files/run/macro-parse-position-malformed/Impls_Macros_1.scala
  169. +2 −2 test/files/run/macro-parse-position/Impls_Macros_1.scala
  170. +2 −2 test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala
  171. +2 −2 test/files/run/macro-quasiquotes/Macros_1.scala
  172. +2 −2 test/files/run/macro-range/Common_1.scala
  173. +2 −2 test/files/run/macro-range/Expansion_Impossible_2.scala
  174. +2 −2 test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala
  175. +2 −2 test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala
  176. +2 −2 test/files/run/macro-reify-basic/Macros_1.scala
  177. +1 −1  test/files/run/macro-reify-freevars/Macros_1.scala
  178. +4 −4 test/files/run/macro-reify-nested-a/Impls_Macros_1.scala
  179. +4 −4 test/files/run/macro-reify-nested-b/Impls_Macros_1.scala
  180. +2 −2 test/files/run/macro-reify-ref-to-packageless/Impls_1.scala
  181. +2 −2 test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
  182. +3 −3 test/files/run/macro-reify-staticXXX/Macros_1.scala
  183. +2 −2 test/files/run/macro-reify-tagful-a/Macros_1.scala
  184. +2 −2 test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala
  185. +2 −2 test/files/run/macro-reify-type/Macros_1.scala
  186. +2 −2 test/files/run/macro-reify-unreify/Macros_1.scala
  187. +5 −5 test/files/run/macro-repl-basic.check
  188. +4 −4 test/files/run/macro-repl-basic.scala
  189. +4 −4 test/files/run/macro-repl-dontexpand.check
  190. +2 −2 test/files/run/macro-repl-dontexpand.scala
  191. +2 −2 test/files/run/macro-settings/Impls_Macros_1.scala
  192. +2 −2 test/files/run/macro-sip19-revised/Impls_Macros_1.scala
  193. +2 −2 test/files/run/macro-sip19/Impls_Macros_1.scala
  194. +2 −2 test/files/run/macro-subpatterns/Macro_1.scala
  195. +4 −4 test/files/run/macro-system-properties.check
  196. +2 −2 test/files/run/macro-system-properties.scala
  197. +2 −2 test/files/run/macro-term-declared-in-annotation/Impls_1.scala
  198. +2 −2 test/files/run/macro-term-declared-in-anonymous/Impls_1.scala
  199. +2 −2 test/files/run/macro-term-declared-in-block/Impls_1.scala
  200. +2 −2 test/files/run/macro-term-declared-in-class-class/Impls_1.scala
  201. +2 −2 test/files/run/macro-term-declared-in-class-object/Impls_1.scala
  202. +2 −2 test/files/run/macro-term-declared-in-class/Impls_1.scala
  203. +2 −2 test/files/run/macro-term-declared-in-default-param/Impls_1.scala
  204. +2 −2 test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala
  205. +2 −2 test/files/run/macro-term-declared-in-method/Impls_1.scala
  206. +2 −2 test/files/run/macro-term-declared-in-object-class/Impls_1.scala
  207. +2 −2 test/files/run/macro-term-declared-in-object-object/Impls_1.scala
  208. +2 −2 test/files/run/macro-term-declared-in-object/Impls_1.scala
  209. +2 −2 test/files/run/macro-term-declared-in-package-object/Impls_1.scala
  210. +2 −2 test/files/run/macro-term-declared-in-refinement/Impls_1.scala
  211. +2 −2 test/files/run/macro-term-declared-in-trait/Impls_1.scala
  212. +3 −3 test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala
  213. +3 −3 test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala
  214. +3 −3 test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala
  215. +3 −3 test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala
  216. +2 −2 test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala
  217. +3 −3 test/files/run/macro-vampire-false-warning/Macros_1.scala
  218. +2 −2 test/files/run/macro-whitebox-dynamic-materialization/Macros_1.scala
  219. +2 −2 test/files/run/macro-whitebox-extractor/Macros_1.scala
  220. +2 −2 test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala
  221. +2 −2 test/files/run/macro-whitebox-structural/Impls_Macros_1.scala
  222. +2 −2 test/files/run/macroPlugins-macroArgs/Macros_2.scala
  223. +3 −3 test/files/run/macroPlugins-macroExpand/Macros_2.scala
  224. +2 −2 test/files/run/macroPlugins-macroRuntime/Macros_2.scala
  225. +3 −3 test/files/run/macroPlugins-typedMacroBody/Macros_2.scala
  226. +8 −8 test/files/run/repl-term-macros.check
  227. +4 −4 test/files/run/repl-term-macros.scala
  228. +2 −2 test/files/run/t5713/Impls_Macros_1.scala
  229. +2 −2 test/files/run/t5753_1/Impls_Macros_1.scala
  230. +2 −2 test/files/run/t5753_2/Impls_Macros_1.scala
  231. +3 −2 test/files/run/t5894.scala
  232. +2 −2 test/files/run/t5903a/Macros_1.scala
  233. +2 −2 test/files/run/t5903b/Macros_1.scala
  234. +2 −2 test/files/run/t5903c/Macros_1.scala
  235. +2 −2 test/files/run/t5903d/Macros_1.scala
  236. +2 −2 test/files/run/t5923a/Macros_1.scala
  237. +2 −2 test/files/run/t5923d/Macros_1.scala
  238. +3 −3 test/files/run/t5940.scala
  239. +5 −5 test/files/run/t6187.check
  240. +2 −2 test/files/run/t6187.scala
  241. +2 −2 test/files/run/t6221/Macros_1.scala
  242. +4 −4 test/files/run/t6381.check
  243. +2 −2 test/files/run/t6381.scala
  244. +2 −2 test/files/run/t6394a/Macros_1.scala
  245. +2 −2 test/files/run/t6394b/Macros_1.scala
  246. +2 −2 test/files/run/t6662/Macro_1.scala
  247. +1 −1  test/files/run/t6992/Macros_1.scala
  248. +2 −2 test/files/run/t7008-scala-defined/Impls_Macros_2.scala
  249. +2 −2 test/files/run/t7008/Impls_Macros_2.scala
  250. +2 −2 test/files/run/t7047/Impls_Macros_1.scala
  251. +2 −2 test/files/run/t7157/Impls_Macros_1.scala
  252. +2 −2 test/files/run/t7240/Macros_1.scala
  253. +2 −2 test/files/run/t7375b/Macros_1.scala
  254. +3 −3 test/files/run/t7617a/Macros_1.scala
  255. +2 −2 test/files/run/t7617b/Macros_1.scala
  256. +2 −2 test/files/run/t7657/Macros_1.scala
  257. +2 −2 test/files/run/t7777/Macros_1.scala
  258. +1 −1  test/files/run/t7871/Macros_1.scala
  259. +2 −2 test/files/run/t8048a/Macros_1.scala
  260. +4 −4 test/files/run/t8048b/Macros_1.scala
  261. +2 −2 test/files/run/t8104/Macros_1.scala
  262. +2 −2 test/files/run/toolbox_current_run_compiles.scala
  263. +2 −2 test/files/run/typed-annotated/Macros_1.scala
  264. +2 −2 test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala
  265. +2 −2 test/pending/run/macro-expand-default/Impls_1.scala
  266. +1 −1  test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala
  267. +2 −2 test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala
  268. +2 −2 test/pending/run/macro-expand-named/Impls_1.scala
  269. +2 −2 test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala
  270. +2 −2 test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala
  271. +2 −2 test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala
  272. +1 −1  test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala
  273. +2 −2 test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala
  274. +1 −1  test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala
  275. +2 −2 test/pending/run/macro-reify-array/Macros_1.scala
  276. +2 −2 test/pending/run/macro-reify-tagful-b/Macros_1.scala
  277. +2 −2 test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala
  278. +2 −2 test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala
  279. +2 −2 test/scaladoc/run/SI-6812.scala
  280. +2 −2 test/scaladoc/run/SI-6812b.scala
View
2  src/compiler/scala/reflect/macros/compiler/Errors.scala
@@ -51,7 +51,7 @@ trait Errors extends Traces {
def MacroBundleNonStaticError() = bundleRefError("macro bundles must be static")
- def MacroBundleWrongShapeError() = bundleRefError("macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member")
+ def MacroBundleWrongShapeError() = bundleRefError("macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member")
// compatibility errors
View
4 src/compiler/scala/reflect/macros/compiler/Resolvers.scala
@@ -46,8 +46,8 @@ trait Resolvers {
if (!isMacroBundleProtoType(bundleProto.tpe)) MacroBundleWrongShapeError()
if (!bundleProto.owner.isStaticOwner) MacroBundleNonStaticError()
- // synthesize the bundle, i.e. given a static `trait Foo extends Macro { def expand = ... } `
- // create a top-level definition `class Foo$Bundle(val c: BlackboxContext/WhiteboxContext) extends Foo` in a package next to `Foo`
+ // synthesize the bundle, i.e. given a static `trait Foo extends *box.Macro { def expand = ... } `
+ // create a top-level definition `class Foo$Bundle(val c: *box.Context) extends Foo` in a package next to `Foo`
val bundlePid = gen.mkUnattributedRef(bundlePkg)
val bundlePrefix =
if (bundlePkg == EmptyPackageClass) bundleProto.fullName('$')
View
12 src/compiler/scala/reflect/macros/compiler/Validators.scala
@@ -93,20 +93,20 @@ trait Validators {
*
* For the following macro impl:
* def fooBar[T: c.WeakTypeTag]
- * (c: scala.reflect.macros.BlackboxContext)
+ * (c: scala.reflect.macros.blackbox.Context)
* (xs: c.Expr[List[T]])
* : c.Expr[T] = ...
*
* This function will return:
- * (c: scala.reflect.macros.BlackboxContext)(xs: c.Expr[List[T]])c.Expr[T]
+ * (c: scala.reflect.macros.blackbox.Context)(xs: c.Expr[List[T]])c.Expr[T]
*
* Note that type tag evidence parameters are not included into the result.
* Type tag context bounds for macro impl tparams are optional.
* Therefore compatibility checks ignore such parameters, and we don't need to bother about them here.
*
* This method cannot be reduced to just macroImpl.info, because macro implementations might
- * come in different shapes. If the implementation is an apply method of a BlackboxMacro/WhiteboxMacro-compatible object,
- * then it won't have (c: BlackboxContext/WhiteboxContext) in its parameters, but will rather refer to BlackboxMacro/WhiteboxMacro.c.
+ * come in different shapes. If the implementation is an apply method of a *box.Macro-compatible object,
+ * then it won't have (c: *box.Context) in its parameters, but will rather refer to *boxMacro.c.
*
* @param macroImpl The macro implementation symbol
*/
@@ -123,8 +123,8 @@ trait Validators {
* def foo[T](xs: List[T]): T = macro fooBar
*
* This function will return:
- * (c: scala.reflect.macros.BlackboxContext)(xs: c.Expr[List[T]])c.Expr[T] or
- * (c: scala.reflect.macros.WhiteboxContext)(xs: c.Expr[List[T]])c.Expr[T]
+ * (c: scala.reflect.macros.blackbox.Context)(xs: c.Expr[List[T]])c.Expr[T] or
+ * (c: scala.reflect.macros.whitebox.Context)(xs: c.Expr[List[T]])c.Expr[T]
*
* Note that type tag evidence parameters are not included into the result.
* Type tag context bounds for macro impl tparams are optional.
View
4 src/compiler/scala/reflect/macros/contexts/Context.scala
@@ -3,8 +3,8 @@ package contexts
import scala.tools.nsc.Global
-abstract class Context extends scala.reflect.macros.BlackboxContext
- with scala.reflect.macros.WhiteboxContext
+abstract class Context extends scala.reflect.macros.blackbox.Context
+ with scala.reflect.macros.whitebox.Context
with Aliases
with Enclosures
with Names
View
2  src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -1145,7 +1145,7 @@ trait Implicits {
gen.mkAttributedThis(thisSym)
case _ =>
// if `pre` is not a PDT, e.g. if someone wrote
- // implicitly[scala.reflect.macros.BlackboxContext#TypeTag[Int]]
+ // implicitly[scala.reflect.macros.blackbox.Context#TypeTag[Int]]
// then we need to fail, because we don't know the prefix to use during type reification
// upd. we also need to fail silently, because this is a very common situation
// e.g. quite often we're searching for BaseUniverse#TypeTag, e.g. for a type tag in any universe
View
16 src/compiler/scala/tools/nsc/typechecker/Macros.scala
@@ -29,7 +29,7 @@ import Fingerprint._
* Then fooBar needs to point to a static method of the following form:
*
* def fooBar[T: c.WeakTypeTag] // type tag annotation is optional
- * (c: scala.reflect.macros.BlackboxContext)
+ * (c: scala.reflect.macros.blackbox.Context)
* (xs: c.Expr[List[T]])
* : c.Expr[T] = {
* ...
@@ -67,7 +67,7 @@ trait Macros extends FastTrack with MacroRuntimes with Traces with Helpers {
*
* This solution is very simple, but unfortunately it's also lacking. If we use it, then
* signatures of macro defs become transitively dependent on scala-reflect.jar
- * (because they refer to macro impls, and macro impls refer to scala.reflect.macros.BlackboxContext/WhiteboxContext defined in scala-reflect.jar).
+ * (because they refer to macro impls, and macro impls refer to *box.Context defined in scala-reflect.jar).
* More details can be found in comments to https://issues.scala-lang.org/browse/SI-5940.
*
* Therefore we have to avoid putting macro impls into binding pickles and come up with our own serialization format.
@@ -81,9 +81,9 @@ trait Macros extends FastTrack with MacroRuntimes with Traces with Helpers {
* and various accounting information necessary when composing an argument list for the reflective invocation.
*/
case class MacroImplBinding(
- // Is this macro impl a bundle (a trait extending BlackboxMacro or WhiteboxMacro) or a vanilla def?
+ // Is this macro impl a bundle (a trait extending *box.Macro) or a vanilla def?
val isBundle: Boolean,
- // Is this macro impl blackbox (i.e. having BlackboxContext in its signature)?
+ // Is this macro impl blackbox (i.e. having blackbox.Context in its signature)?
val isBlackbox: Boolean,
// Java class name of the class that contains the macro implementation
// is used to load the corresponding object with Java reflection
@@ -97,8 +97,8 @@ trait Macros extends FastTrack with MacroRuntimes with Traces with Helpers {
// * c.Expr[T] => LiftedTyped
// * c.Tree => LiftedUntyped
// * c.WeakTypeTag[T] => Tagged(index of the type parameter corresponding to that type tag)
- // * everything else (e.g. scala.reflect.macros.BlackboxContext/WhiteboxContext) => Other
- // f.ex. for: def impl[T: WeakTypeTag, U, V: WeakTypeTag](c: BlackboxContext)(x: c.Expr[T], y: c.Tree): (U, V) = ???
+ // * everything else (e.g. *box.Context) => Other
+ // f.ex. for: def impl[T: WeakTypeTag, U, V: WeakTypeTag](c: blackbox.Context)(x: c.Expr[T], y: c.Tree): (U, V) = ???
// `signature` will be equal to List(List(Other), List(LiftedTyped, LiftedUntyped), List(Tagged(0), Tagged(2)))
signature: List[List[Fingerprint]],
// type arguments part of a macro impl ref (the right-hand side of a macro definition)
@@ -116,7 +116,7 @@ trait Macros extends FastTrack with MacroRuntimes with Traces with Helpers {
* with synthetic content that carries the payload described in `MacroImplBinding`.
*
* For example, for a pair of macro definition and macro implementation:
- * def impl(c: scala.reflect.macros.BlackboxContext): c.Expr[Unit] = ???
+ * def impl(c: scala.reflect.macros.blackbox.Context): c.Expr[Unit] = ???
* def foo: Unit = macro impl
*
* We will have the following annotation added on the macro definition `foo`:
@@ -478,7 +478,7 @@ trait Macros extends FastTrack with MacroRuntimes with Traces with Helpers {
}
/** Keeps track of macros in-flight.
- * See more informations in comments to `openMacros` in `scala.reflect.macros.WhiteboxContext`.
+ * See more informations in comments to `openMacros` in `scala.reflect.macros.whitebox.Context`.
*/
var _openMacros = List[MacroContext]()
def openMacros = _openMacros
View
4 src/partest-extras/scala/tools/partest/Util.scala
@@ -16,8 +16,8 @@ object Util {
*/
def trace[A](a: A) = macro traceImpl[A]
- import scala.reflect.macros.BlackboxContext
- def traceImpl[A: c.WeakTypeTag](c: BlackboxContext)(a: c.Expr[A]): c.Expr[A] = {
+ import scala.reflect.macros.blackbox.Context
+ def traceImpl[A: c.WeakTypeTag](c: Context)(a: c.Expr[A]): c.Expr[A] = {
import c.universe._
import definitions._
View
2  src/reflect/scala/reflect/api/Exprs.scala
@@ -106,7 +106,7 @@ trait Exprs { self: Universe =>
*
* The corresponding macro implementation should have the following signature (note how the return type denotes path-dependency on x):
* {{{
- * object Impls { def foo_impl(c: BlackboxContext)(x: c.Expr[X]): c.Expr[x.value.T] = ... }
+ * object Impls { def foo_impl(c: Context)(x: c.Expr[X]): c.Expr[x.value.T] = ... }
* }}}
*/
@compileTimeOnly("cannot use value except for signatures of macro implementations")
View
2  src/reflect/scala/reflect/api/Importers.scala
@@ -34,7 +34,7 @@ package api
* {{{
* def staticEval[T](x: T) = macro staticEval[T]
*
- * def staticEval[T](c: scala.reflect.macros.BlackboxContext)(x: c.Expr[T]) = {
+ * def staticEval[T](c: scala.reflect.macros.blackbox.Context)(x: c.Expr[T]) = {
* // creates a runtime reflection universe to host runtime compilation
* import scala.reflect.runtime.{universe => ru}
* val mirror = ru.runtimeMirror(c.libraryClassLoader)
View
6 src/reflect/scala/reflect/api/Mirrors.scala
@@ -29,19 +29,19 @@ package api
* Compile-time `Mirror`s make use of only classloader `Mirror`s to load `Symbol`s
* by name.
*
- * The entry point to classloader `Mirror`s is via [[scala.reflect.macros.BlackboxContext#mirror]] or [[scala.reflect.macros.WhiteboxContext#mirror]].
+ * The entry point to classloader `Mirror`s is via [[scala.reflect.macros.blackbox.Context#mirror]] or [[scala.reflect.macros.whitebox.Context#mirror]].
* Typical methods which use classloader `Mirror`s include [[scala.reflect.api.Mirror#staticClass]],
* [[scala.reflect.api.Mirror#staticModule]], and [[scala.reflect.api.Mirror#staticPackage]]. For
* example:
* {{{
- * import scala.reflect.macros.BlackboxContext
+ * import scala.reflect.macros.blackbox.Context
*
* case class Location(filename: String, line: Int, column: Int)
*
* object Macros {
* def currentLocation: Location = macro impl
*
- * def impl(c: BlackboxContext): c.Expr[Location] = {
+ * def impl(c: Context): c.Expr[Location] = {
* import c.universe._
* val pos = c.macroApplication.pos
* val clsLocation = c.mirror.staticModule("Location") // get symbol of "Location" object
View
6 src/reflect/scala/reflect/api/Universe.scala
@@ -41,11 +41,11 @@ package api
* res1: reflect.runtime.universe.Type = scala.Either[String,Int]
* }}}
*
- * To obtain a `Universe` for use within a Scala macro, use [[scala.reflect.macros.BlackboxContext#universe]].
- * or [[scala.reflect.macros.WhiteboxContext#universe]]. For example:
+ * To obtain a `Universe` for use within a Scala macro, use [[scala.reflect.macros.blackbox.Context#universe]].
+ * or [[scala.reflect.macros.whitebox.Context#universe]]. For example:
* {{{
* def printf(format: String, params: Any*): Unit = macro impl
- * def impl(c: BlackboxContext)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = {
+ * def impl(c: Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = {
* import c.universe._
* ...
* }
View
8 src/reflect/scala/reflect/internal/Definitions.scala
@@ -482,12 +482,12 @@ trait Definitions extends api.StandardDefinitions {
lazy val TypeCreatorClass = getClassIfDefined("scala.reflect.api.TypeCreator") // defined in scala-reflect.jar, so we need to be careful
lazy val TreeCreatorClass = getClassIfDefined("scala.reflect.api.TreeCreator") // defined in scala-reflect.jar, so we need to be careful
- lazy val BlackboxMacroClass = getClassIfDefined("scala.reflect.macros.BlackboxMacro") // defined in scala-reflect.jar, so we need to be careful
+ lazy val BlackboxMacroClass = getClassIfDefined("scala.reflect.macros.blackbox.Macro") // defined in scala-reflect.jar, so we need to be careful
def BlackboxMacroContextValue = BlackboxMacroClass.map(sym => getMemberValue(sym, nme.c))
- lazy val WhiteboxMacroClass = getClassIfDefined("scala.reflect.macros.WhiteboxMacro") // defined in scala-reflect.jar, so we need to be careful
+ lazy val WhiteboxMacroClass = getClassIfDefined("scala.reflect.macros.whitebox.Macro") // defined in scala-reflect.jar, so we need to be careful
def WhiteboxMacroContextValue = WhiteboxMacroClass.map(sym => getMemberValue(sym, nme.c))
- lazy val BlackboxContextClass = getClassIfDefined("scala.reflect.macros.BlackboxContext") // defined in scala-reflect.jar, so we need to be careful
- lazy val WhiteboxContextClass = getClassIfDefined("scala.reflect.macros.WhiteboxContext") // defined in scala-reflect.jar, so we need to be careful
+ lazy val BlackboxContextClass = getClassIfDefined("scala.reflect.macros.blackbox.Context") // defined in scala-reflect.jar, so we need to be careful
+ lazy val WhiteboxContextClass = getClassIfDefined("scala.reflect.macros.whitebox.Context") // defined in scala-reflect.jar, so we need to be careful
def MacroContextPrefix = BlackboxContextClass.map(sym => getMemberMethod(sym, nme.prefix))
def MacroContextPrefixType = BlackboxContextClass.map(sym => getTypeMember(sym, tpnme.PrefixType))
def MacroContextUniverse = BlackboxContextClass.map(sym => getMemberMethod(sym, nme.universe))
View
4 src/reflect/scala/reflect/macros/Aliases.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that defines shorthands for the
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that defines shorthands for the
* most frequently used types and functions of the underlying compiler universe.
*/
trait Aliases {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** The type of symbols representing declarations. */
type Symbol = universe.Symbol
View
6 src/reflect/scala/reflect/macros/Enclosures.scala
@@ -7,13 +7,13 @@ import scala.language.existentials // SI-6541
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that exposes
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that exposes
* enclosing trees (method, class, compilation unit and currently compiled application),
* the enclosing position of the macro expansion, as well as macros and implicits
* that are currently in-flight.
*/
trait Enclosures {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** The tree that undergoes macro expansion.
* Can be useful to get an offset or a range position of the entire tree being processed.
@@ -30,7 +30,7 @@ trait Enclosures {
* Unlike `openMacros`, this is a val, which means that it gets initialized when the context is created
* and always stays the same regardless of whatever happens during macro expansion.
*/
- def enclosingMacros: List[BlackboxContext]
+ def enclosingMacros: List[blackbox.Context]
/** Tries to guess a position for the enclosing application.
* But that is simple, right? Just dereference `pos` of `macroApplication`? Not really.
View
8 src/reflect/scala/reflect/macros/Evals.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that provides
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that provides
* a facility to evaluate trees.
*/
trait Evals {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Takes a typed wrapper for a tree of type `T` and evaluates it to a value of type `T`.
*
@@ -21,12 +21,12 @@ trait Evals {
* mutates the tree in place, therefore the conventional approach is to `duplicate` the tree first.
*
* {{{
- * scala> def impl(c: BlackboxContext)(x: c.Expr[String]) = {
+ * scala> def impl(c: Context)(x: c.Expr[String]) = {
* | val x1 = c.Expr[String](c.resetAllAttrs(x.tree.duplicate))
* | println(s"compile-time value is: \${c.eval(x1)}")
* | x
* | }
- * impl: (c: BlackboxContext)(x: c.Expr[String])c.Expr[String]
+ * impl: (c: Context)(x: c.Expr[String])c.Expr[String]
*
* scala> def test(x: String) = macro impl
* test: (x: String)String
View
4 src/reflect/scala/reflect/macros/ExprUtils.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that defines shorthands for the
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that defines shorthands for the
* most common `Expr`-creating functions.
*/
trait ExprUtils {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Shorthand for `Literal(Constant(null))` in the underlying `universe`. */
@deprecated("Use quasiquotes instead", "2.11.0")
View
4 src/reflect/scala/reflect/macros/FrontEnds.scala
@@ -5,12 +5,12 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* provides facilities to communicate with the compiler's front end
* (emit warnings, errors and other sorts of messages).
*/
trait FrontEnds {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** For sending a message which should not be labeled as a warning/error,
* but also shouldn't require -verbose to be visible.
View
4 src/reflect/scala/reflect/macros/Infrastructure.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* provides facilities to communicate with the compiler's infrastructure.
*/
trait Infrastructure {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Exposes macro-specific settings as a list of strings.
* These settings are passed to the compiler via the "-Xmacro-settings:setting1,setting2...,settingN" command-line option.
View
4 src/reflect/scala/reflect/macros/Names.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* provides functions that generate unique names.
*/
trait Names {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Creates a unique string. */
@deprecated("Use freshName instead", "2.11.0")
View
4 src/reflect/scala/reflect/macros/Parsers.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* exposes functions to parse strings with Scala code into trees.
*/
trait Parsers {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Parses a string with a Scala expression into an abstract syntax tree.
* Only works for expressions, i.e. parsing a package declaration will fail.
View
4 src/reflect/scala/reflect/macros/Reifiers.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* exposes functions to save reflection artifacts for runtime.
*/
trait Reifiers {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Given a tree, generate a tree that when compiled and executed produces the original tree.
* For more information and examples see the documentation for `Universe.reify`.
View
6 src/reflect/scala/reflect/macros/Typers.scala
@@ -5,11 +5,11 @@ package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
- * A slice of [[scala.reflect.macros.BlackboxContext the Scala macros context]] that
+ * A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* partially exposes the type checker to macro writers.
*/
trait Typers {
- self: BlackboxContext =>
+ self: blackbox.Context =>
/** Contexts that represent macros in-flight, including the current one. Very much like a stack trace, but for macros only.
* Can be useful for interoperating with other macros and for imposing compiler-friendly limits on macro expansion.
@@ -21,7 +21,7 @@ trait Typers {
* Unlike `enclosingMacros`, this is a def, which means that it gets recalculated on every invocation,
* so it might change depending on what is going on during macro expansion.
*/
- def openMacros: List[BlackboxContext]
+ def openMacros: List[blackbox.Context]
/** @see `Typers.typecheck`
*/
View
29 ...eflect/scala/reflect/macros/BlackboxContext.scala → ...flect/scala/reflect/macros/blackbox/Context.scala
@@ -1,6 +1,7 @@
package scala
package reflect
package macros
+package blackbox
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
@@ -24,24 +25,24 @@ package macros
* enclosing trees and compilation units, evaluating trees, logging warnings/errors and much more.
* Refer to the documentation of top-level traits in this package to learn the details.
*
- * If a macro def refers to a macro impl that uses `BlackboxContext`, then this macro def becomes a blackbox macro,
+ * If a macro def refers to a macro impl that uses `blackbox.Context`, then this macro def becomes a blackbox macro,
* which means that its expansion will be upcast to its return type, enforcing faithfullness of that macro to its
- * type signature. Whitebox macros, i.e. the ones defined with `WhiteboxContext`, aren't bound by this restriction,
+ * type signature. Whitebox macros, i.e. the ones defined with `whitebox.Context`, aren't bound by this restriction,
* which enables a number of important use cases, but they are also going to enjoy less support than blackbox macros,
* so choose wisely. See the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]] for more information.
*
- * @see `scala.reflect.macros.WhiteboxContext`
+ * @see `scala.reflect.macros.whitebox.Context`
*/
-trait BlackboxContext extends Aliases
- with Enclosures
- with Names
- with Reifiers
- with FrontEnds
- with Infrastructure
- with Typers
- with Parsers
- with Evals
- with ExprUtils {
+trait Context extends Aliases
+ with Enclosures
+ with Names
+ with Reifiers
+ with FrontEnds
+ with Infrastructure
+ with Typers
+ with Parsers
+ with Evals
+ with ExprUtils {
/** The compile-time universe. */
val universe: Universe
@@ -63,7 +64,7 @@ trait BlackboxContext extends Aliases
* scala> class Coll[T] {
* | def filter(p: T => Boolean): Coll[T] = macro M.filter[T]
* | }; object M {
- * | def filter[T](c: BlackboxContext { type PrefixType = Coll[T] })
+ * | def filter[T](c: Context { type PrefixType = Coll[T] })
* | (p: c.Expr[T => Boolean]): c.Expr[Coll[T]] =
* | {
* | println(c.prefix.tree)
View
18 src/reflect/scala/reflect/macros/BlackboxMacro.scala → ...reflect/scala/reflect/macros/blackbox/Macro.scala
@@ -1,20 +1,24 @@
-package scala.reflect
+package scala
+package reflect
package macros
+package blackbox
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
* Traditionally macro implementations are defined as methods,
* but this trait provides an alternative way of encoding macro impls as
- * bundles, traits which extend `scala.reflect.macros.BlackboxMacro` or`scala.reflect.macros.WhiteboxMacro` .
+ * bundles, traits which extend `scala.reflect.macros.blackbox.Macro` or`scala.reflect.macros.whitebox.Macro` .
*
* Instead of:
*
- * def impl[T: c.WeakTypeTag](c: BlackboxContext)(x: c.Expr[Int]) = ...
+ * import scala.reflect.macros.blackbox._
+ * def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = ...
*
* One can write:
*
- * trait Impl extends BlackboxMacro {
+ * import scala.reflect.macros.blackbox._
+ * trait Impl extends Macro {
* def apply[T: c.WeakTypeTag](x: c.Expr[Int]) = ...
* }
*
@@ -24,13 +28,13 @@ package macros
* are complex and need to be modularized. State of the art technique of addressing this need is quite heavyweight:
* http://docs.scala-lang.org/overviews/macros/overview.html#writing_bigger_macros.
*
- * @see `scala.reflect.macros.WhiteboxMacro`
+ * @see `scala.reflect.macros.whitebox.Macro`
*/
-trait BlackboxMacro {
+trait Macro {
/** The context to be used by the macro implementation.
*
* Vanilla macro implementations have to carry it in their signatures, however when a macro is a full-fledged module,
* it can define the context next to the implementation, makes implementation signature more lightweight.
*/
- val c: BlackboxContext
+ val c: Context
}
View
8 src/reflect/scala/reflect/macros/package.scala
@@ -19,10 +19,10 @@ package object macros {
* with the former being better supported and the latter being more powerful. You can read about
* the details of the split and the associated trade-offs in the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]].
*
- * `scala.reflect.macros.Context` follows this tendency and turns into `scala.reflect.macros.BlackboxContext`
- * and `scala.reflect.macros.WhiteboxContext`. The original `Context` is left in place for compatibility reasons,
+ * `scala.reflect.macros.Context` follows this tendency and turns into `scala.reflect.macros.blackbox.Context`
+ * and `scala.reflect.macros.whitebox.Context`. The original `Context` is left in place for compatibility reasons,
* but it is now deprecated, nudging the users to choose between blackbox and whitebox macros.
*/
- @deprecated("Use BlackboxContext or WhiteboxContext instead", "2.11.0")
- type Context = WhiteboxContext
+ @deprecated("Use blackbox.Context or whitebox.Context instead", "2.11.0")
+ type Context = whitebox.Context
}
View
13 ...eflect/scala/reflect/macros/WhiteboxContext.scala → ...flect/scala/reflect/macros/whitebox/Context.scala
@@ -1,6 +1,7 @@
package scala
package reflect
package macros
+package whitebox
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
@@ -24,22 +25,22 @@ package macros
* enclosing trees and compilation units, evaluating trees, logging warnings/errors and much more.
* Refer to the documentation of top-level traits in this package to learn the details.
*
- * If a macro def refers to a macro impl that uses `WhiteboxContext`, then this macro def becomes a whitebox macro,
+ * If a macro def refers to a macro impl that uses `whitebox.Context`, then this macro def becomes a whitebox macro,
* gaining the ability to refine the type of its expansion beyond its official return type, which enables a number of important use cases.
- * Blackbox macros, i.e. the ones defined with `BlackboxContext`, can't do that, so they are less powerful.
+ * Blackbox macros, i.e. the ones defined with `blackbox.Context`, can't do that, so they are less powerful.
* However blackbox macros are also going to enjoy better support than whitebox macros, so choose wisely.
* See the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]] for more information.
*
- * @see `scala.reflect.macros.BlackboxContext`
+ * @see `scala.reflect.macros.blackbox.Context`
*/
-trait WhiteboxContext extends BlackboxContext {
+trait Context extends blackbox.Context {
/** @inheritdoc
*/
- def openMacros: List[WhiteboxContext]
+ def openMacros: List[Context]
/** @inheritdoc
*/
- def enclosingMacros: List[WhiteboxContext]
+ def enclosingMacros: List[Context]
/** Information about one of the currently considered implicit candidates.
* Candidates are used in plural form, because implicit parameters may themselves have implicit parameters,
View
18 src/reflect/scala/reflect/macros/WhiteboxMacro.scala → ...reflect/scala/reflect/macros/whitebox/Macro.scala
@@ -1,20 +1,24 @@
-package scala.reflect
+package scala
+package reflect
package macros
+package whitebox
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
* Traditionally macro implementations are defined as methods,
* but this trait provides an alternative way of encoding macro impls as
- * bundles, traits which extend `scala.reflect.macros.BlackboxMacro` or`scala.reflect.macros.WhiteboxMacro` .
+ * bundles, traits which extend `scala.reflect.macros.blackbox.Macro` or`scala.reflect.macros.whitebox.Macro` .
*
* Instead of:
*
- * def impl[T: c.WeakTypeTag](c: WhiteboxContext)(x: c.Expr[Int]) = ...
+ * import scala.reflect.macros.whitebox._
+ * def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = ...
*
* One can write:
*
- * trait Impl extends WhiteboxMacro {
+ * import scala.reflect.macros.whitebox._
+ * trait Impl extends Macro {
* def apply[T: c.WeakTypeTag](x: c.Expr[Int]) = ...
* }
*
@@ -24,13 +28,13 @@ package macros
* are complex and need to be modularized. State of the art technique of addressing this need is quite heavyweight:
* http://docs.scala-lang.org/overviews/macros/overview.html#writing_bigger_macros.
*
- * @see `scala.reflect.macros.BlackboxMacro`
+ * @see `scala.reflect.macros.blackbox.Macro`
*/
-trait WhiteboxMacro {
+trait Macro {
/** The context to be used by the macro implementation.
*
* Vanilla macro implementations have to carry it in their signatures, however when a macro is a full-fledged module,
* it can define the context next to the implementation, makes implementation signature more lightweight.
*/
- val c: WhiteboxContext
+ val c: Context
}
View
2  src/reflect/scala/reflect/runtime/package.scala
@@ -26,7 +26,7 @@ package object runtime {
package runtime {
private[scala] object Macros {
- def currentMirror(c: scala.reflect.macros.BlackboxContext): c.Expr[universe.Mirror] = {
+ def currentMirror(c: scala.reflect.macros.blackbox.Context): c.Expr[universe.Mirror] = {
import c.universe._
val runtimeClass = c.reifyEnclosingRuntimeClass
if (runtimeClass.isEmpty) c.abort(c.enclosingPosition, "call site does not have an enclosing class")
View
4 test/files/neg/macro-abort/Macros_1.scala
@@ -1,8 +1,8 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
c.abort(c.enclosingPosition, "aborted")
}
def abort = macro impl
View
8 test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala
@@ -1,17 +1,17 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def foo(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr[Int](q"$x + 1")
}
- def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def bar(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr[Int](q"$x + 2")
}
- def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def quux(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr[Int](q"$x + 3")
}
View
4 test/files/neg/macro-blackbox-dynamic-materialization/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.language.experimental.macros
trait Foo[T]
@@ -15,7 +15,7 @@ object Foo extends LowPriority {
}
object Macros {
- def impl[T: c.WeakTypeTag](c: BlackboxContext) = {
+ def impl[T: c.WeakTypeTag](c: Context) = {
import c.universe._
val tpe = weakTypeOf[T]
if (tpe.members.exists(_.typeSignature =:= typeOf[Int]))
View
4 test/files/neg/macro-blackbox-extractor/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Extractor {
@@ -6,7 +6,7 @@ object Extractor {
}
object Macros {
- def unapplyImpl(c: BlackboxContext)(x: c.Tree) = {
+ def unapplyImpl(c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
View
4 test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala
@@ -1,5 +1,5 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
trait Iso[T, U] {
def to(t : T) : U
@@ -8,7 +8,7 @@ trait Iso[T, U] {
object Iso {
implicit def materializeIso[T, U]: Iso[T, U] = macro impl[T, U]
- def impl[T: c.WeakTypeTag, U: c.WeakTypeTag](c: BlackboxContext): c.Expr[Iso[T, U]] = {
+ def impl[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context): c.Expr[Iso[T, U]] = {
import c.universe._
import definitions._
import Flag._
View
2  test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
object Macros {
- def impl(c: scala.reflect.macros.BlackboxContext) = {
+ def impl(c: scala.reflect.macros.blackbox.Context) = {
import c.universe._
q"""
trait Foo {
View
2  test/files/neg/macro-bundle-abstract.check
@@ -1,4 +1,4 @@
macro-bundle-abstract.scala:4: error: class Bundle$Bundle needs to be abstract, since method deferred in trait Bundle of type => Int is not defined
-trait Bundle extends BlackboxMacro {
+trait Bundle extends Macro {
^
one error found
View
4 test/files/neg/macro-bundle-abstract.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
+import scala.reflect.macros.blackbox.Macro
-trait Bundle extends BlackboxMacro {
+trait Bundle extends Macro {
def deferred: Int
def impl = ???
}
View
2  test/files/neg/macro-bundle-class.check
@@ -1,4 +1,4 @@
-macro-bundle-class.scala:10: error: macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member
+macro-bundle-class.scala:9: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
def foo = macro Bundle.impl
^
one error found
View
5 test/files/neg/macro-bundle-class.scala
@@ -1,8 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox._
-class Bundle(val c: BlackboxContext) extends BlackboxMacro {
+class Bundle(val c: Context) extends Macro {
def impl = ???
}
View
2  test/files/neg/macro-bundle-mixbox.check
@@ -1,4 +1,4 @@
-macro-bundle-mixbox.scala:9: error: macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member
+macro-bundle-mixbox.scala:10: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
def foo = macro Bundle.impl
^
one error found
View
3  test/files/neg/macro-bundle-mixbox.scala
@@ -1,5 +1,6 @@
import scala.language.experimental.macros
-import scala.reflect.macros.{BlackboxMacro, WhiteboxMacro}
+import scala.reflect.macros.blackbox.{Macro => BlackboxMacro}
+import scala.reflect.macros.whitebox.{Macro => WhiteboxMacro}
trait Bundle extends BlackboxMacro with WhiteboxMacro {
def impl = ???
View
4 test/files/neg/macro-bundle-object.check
@@ -1,6 +1,6 @@
macro-bundle-object.scala:10: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
found : : Nothing
number of parameter sections differ
def foo = macro Bundle.impl
View
6 test/files/neg/macro-bundle-object.scala
@@ -1,8 +1,8 @@
import scala.language.experimental.macros
-import scala.reflect.macros.{BlackboxMacro, BlackboxContext}
+import scala.reflect.macros.blackbox._
-object Bundle extends BlackboxMacro {
- val c: BlackboxContext = ???
+object Bundle extends Macro {
+ val c: Context = ???
def impl = ???
}
View
6 test/files/neg/macro-bundle-polymorphic.check
@@ -1,10 +1,10 @@
-macro-bundle-polymorphic.scala:9: error: macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member
+macro-bundle-polymorphic.scala:9: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
def foo = macro Bundle.impl
^
-macro-bundle-polymorphic.scala:10: error: macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member
+macro-bundle-polymorphic.scala:10: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
def foo = macro Bundle[Int].impl
^
-macro-bundle-polymorphic.scala:11: error: macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member
+macro-bundle-polymorphic.scala:11: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
def foo = macro Bundle[Int, Nothing].impl
^
three errors found
View
4 test/files/neg/macro-bundle-polymorphic.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
+import scala.reflect.macros.blackbox.Macro
-trait Bundle[T] extends BlackboxMacro {
+trait Bundle[T] extends Macro {
def impl = ???
}
View
2  test/files/neg/macro-bundle-trait.check
@@ -1,4 +1,4 @@
-macro-bundle-trait.scala:11: error: macro bundles must be monomorphic traits extending either BlackboxMacro or WhiteboxMacro and not implementing their `val c: BlackboxContext/WhiteboxContext` member
+macro-bundle-trait.scala:10: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
def foo = macro Bundle.impl
^
one error found
View
7 test/files/neg/macro-bundle-trait.scala
@@ -1,9 +1,8 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox._
-trait Bundle extends BlackboxMacro {
- val c: BlackboxContext = ???
+trait Bundle extends Macro {
+ val c: Context = ???
def impl = ???
}
View
4 test/files/neg/macro-cyclic/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
c.universe.reify { implicitly[SourceLocation] }
}
View
4 test/files/neg/macro-divergence-controlled/Impls_Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
trait Complex[T]
@@ -6,7 +6,7 @@ trait Complex[T]
class Foo(val foo: Foo)
object Complex {
- def impl[T: c.WeakTypeTag](c: WhiteboxContext): c.Expr[Complex[T]] = {
+ def impl[T: c.WeakTypeTag](c: Context): c.Expr[Complex[T]] = {
import c.universe._
val tpe = weakTypeOf[T]
for (f <- tpe.declarations.collect{case f: TermSymbol if f.isParamAccessor && !f.isMethod => f}) {
View
4 test/files/neg/macro-exception/Macros_1.scala
@@ -1,8 +1,8 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
throw new Exception()
}
def exception = macro impl
View
4 test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala
@@ -1,11 +1,11 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Helper {
def unapplySeq[T](x: List[T]): Option[Seq[T]] =
}
object Macros {
- def impl[T: c.WeakTypeTag](c: BlackboxContext)(x: c.Expr[List[T]]) = {
+ def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[List[T]]) = {
c.universe.reify(Helper.unapplySeq(x.splice))
}
View
4 test/files/neg/macro-incompatible-macro-engine/Macros_2.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext) = c.universe.Literal(c.universe.Constant(()))
+ def impl(c: Context) = c.universe.Literal(c.universe.Constant(()))
def foo: Unit = macro impl
}
View
20 test/files/neg/macro-invalidimpl.check
@@ -19,28 +19,28 @@ macro [<macro bundle>].<method name>[[<type args>]]
def foo(x: Any) = macro Impls4.foo
^
Macros_Test_2.scala:26: error: ambiguous reference to overloaded definition,
-both method foo in object Impls5 of type (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Any], y: c.Expr[Any])Nothing
-and method foo in object Impls5 of type (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Any])Nothing
+both method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
+and method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any])Nothing
match expected type ?
def foo(x: Any) = macro Impls5.foo
^
Macros_Test_2.scala:27: error: ambiguous reference to overloaded definition,
-both method foo in object Impls5 of type (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Any], y: c.Expr[Any])Nothing
-and method foo in object Impls5 of type (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Any])Nothing
+both method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing
+and method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any])Nothing
match expected type ?
def foo(x: Any, y: Any) = macro Impls5.foo
^
Macros_Test_2.scala:31: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Unit]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(): c.Expr[Unit]
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Unit]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(): c.Expr[Unit]
number of parameter sections differ
def foo1 = macro Impls6.fooEmpty
^
Macros_Test_2.scala:32: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(): c.Expr[Unit]
- or : (c: scala.reflect.macros.BlackboxContext)(): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext): c.Expr[Unit]
+ required: (c: scala.reflect.macros.blackbox.Context)(): c.Expr[Unit]
+ or : (c: scala.reflect.macros.blackbox.Context)(): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context): c.Expr[Unit]
number of parameter sections differ
def bar1() = macro Impls6.fooNullary
^
View
20 test/files/neg/macro-invalidimpl/Impls_1.scala
@@ -1,39 +1,39 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
class Impls1 {
- def foo(c: BlackboxContext)(x: c.Expr[Any]) = ???
+ def foo(c: Context)(x: c.Expr[Any]) = ???
}
object Impls2 {
- def foo(c: BlackboxContext)(x: c.Expr[Any]) = ???
+ def foo(c: Context)(x: c.Expr[Any]) = ???
}
trait MacroHelpers {
object Impls4 {
- def foo(c: BlackboxContext)(x: c.Expr[Any]) = x
+ def foo(c: Context)(x: c.Expr[Any]) = x
}
}
object Impls5 {
- def foo(c: BlackboxContext)(x: c.Expr[Any]) = ???
- def foo(c: BlackboxContext)(x: c.Expr[Any], y: c.Expr[Any]) = ???
+ def foo(c: Context)(x: c.Expr[Any]) = ???
+ def foo(c: Context)(x: c.Expr[Any], y: c.Expr[Any]) = ???
}
object Impls6 {
- def fooNullary(c: BlackboxContext) = {
+ def fooNullary(c: Context) = {
import c.universe._
c.Expr[Unit](q"""Predef.println("it works")""")
}
- def fooEmpty(c: BlackboxContext)() = fooNullary(c)
+ def fooEmpty(c: Context)() = fooNullary(c)
}
object Impls7 {
- def foo[U <: Int](c: BlackboxContext) = ???
+ def foo[U <: Int](c: Context) = ???
}
package foo {
object Impls8 {
- private[foo] def impl(c: BlackboxContext) = ???
+ private[foo] def impl(c: Context) = ???
}
}
View
4 test/files/neg/macro-invalidimpl/Macros_Test_2.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros1 {
val impls = new Impls1
@@ -12,7 +12,7 @@ object Macros2 {
class Macros3 {
object Impls3 {
- def foo(c: BlackboxContext)(x: c.Expr[Any]) = ???
+ def foo(c: Context)(x: c.Expr[Any]) = ???
}
def foo(x: Any) = macro Impls3.foo
View
12 test/files/neg/macro-invalidret.check
@@ -1,14 +1,14 @@
Macros_Test_2.scala:2: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext): Int
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Any]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context): Int
type mismatch for return type: Int does not conform to c.Expr[Any]
def foo1 = macro Impls.foo1
^
Macros_Test_2.scala:3: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext): reflect.runtime.universe.Literal
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Any]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context): reflect.runtime.universe.Literal
type mismatch for return type: reflect.runtime.universe.Literal does not conform to c.Expr[Any]
def foo2 = macro Impls.foo2
^
View
12 test/files/neg/macro-invalidret/Impls_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.reflect.runtime.{universe => ru}
object Impls {
- def foo1(c: BlackboxContext) = 2
- def foo2(c: BlackboxContext) = ru.Literal(ru.Constant(42))
- def foo3(c: BlackboxContext) = ???
- def foo5(c: BlackboxContext) = c.universe.Literal(c.universe.Constant(42))
- def foo6(c: BlackboxContext) = c.Expr[Int](c.universe.Literal(c.universe.Constant(42)))
+ def foo1(c: Context) = 2
+ def foo2(c: Context) = ru.Literal(ru.Constant(42))
+ def foo3(c: Context) = ???
+ def foo5(c: Context) = c.universe.Literal(c.universe.Constant(42))
+ def foo6(c: Context) = c.Expr[Int](c.universe.Literal(c.universe.Constant(42)))
}
View
4 test/files/neg/macro-invalidshape/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(x: c.Expr[Any]) = ???
+ def foo(c: Context)(x: c.Expr[Any]) = ???
}
View
2  test/files/neg/macro-invalidshape/Macros_Test_2.scala
@@ -3,7 +3,7 @@ object Macros {
def foo2(x: Any) = macro Impls.foo(null)(null)
def foo3(x: Any) = macro {2; Impls.foo}
{
- def impl(c: scala.reflect.macros.BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def impl(c: scala.reflect.macros.blackbox.Context) = { import c.universe._; c.Expr[Unit](q"()") }
def foo = macro impl
foo
}
View
6 test/files/neg/macro-invalidsig-params-badtype.check
@@ -1,7 +1,7 @@
Impls_Macros_1.scala:8: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int]): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(x: Int): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int]): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(x: Int): Nothing
type mismatch for parameter x: c.Expr[Int] does not conform to Int
def foo(x: Int) = macro Impls.foo
^
View
4 test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(x: Int) = ???
+ def foo(c: Context)(x: Int) = ???
}
object Macros {
View
58 test/files/neg/macro-invalidsig.check
@@ -2,30 +2,30 @@ Macros_Test_2.scala:2: error: macro implementations cannot have implicit paramet
def foo[U]: Int = macro Impls1.foo[U]
^
Macros_Test_2.scala:6: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
found : : Nothing
number of parameter sections differ
def foo = macro Impls2.foo
^
Macros_Test_2.scala:10: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
found : (c: scala.reflect.api.Universe): Nothing
-type mismatch for parameter c: scala.reflect.macros.BlackboxContext does not conform to scala.reflect.api.Universe
+type mismatch for parameter c: scala.reflect.macros.blackbox.Context does not conform to scala.reflect.api.Universe
def foo = macro Impls3.foo
^
Macros_Test_2.scala:14: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
- found : (cs: scala.reflect.macros.BlackboxContext*): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
+ found : (cs: scala.reflect.macros.blackbox.Context*): Nothing
types incompatible for parameter cs: corresponding is not a vararg parameter
def foo = macro Impls4.foo
^
Macros_Test_2.scala:18: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Any]): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any]): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context): Nothing
number of parameter sections differ
def foo(x: Any) = macro Impls5.foo
^
@@ -33,37 +33,37 @@ Macros_Test_2.scala:22: error: macro implementations cannot have implicit parame
def foo[U](x: Int) = macro Impls6.foo[T, U]
^
Macros_Test_2.scala:26: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int]): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int]): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing
parameter lists have different length, found extra parameter y: c.Expr[Int]
def foo(x: Int) = macro Impls7.foo
^
Macros_Test_2.scala:30: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int]): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(x: c.universe.Symbol): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int]): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(x: c.universe.Symbol): Nothing
type mismatch for parameter x: c.Expr[Int] does not conform to c.universe.Symbol
def foo(x: Int) = macro Impls8.foo
^
Macros_Test_2.scala:34: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree, y: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(xs: c.Expr[Int]*): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree, y: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(xs: c.Expr[Int]*): Nothing
parameter lists have different length, required extra parameter y: c.Expr[Int]
def foo(x: Int, y: Int) = macro Impls9.foo
^
Macros_Test_2.scala:38: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree, y: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(y: c.Expr[Int], x: c.Expr[Int]): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree, y: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing
parameter names differ: x != y
def foo(x: Int, y: Int) = macro Impls10.foo
^
Macros_Test_2.scala:42: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Nothing]
- or : (c: scala.reflect.macros.BlackboxContext): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(U: c.universe.Type): Nothing
+ required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing]
+ or : (c: scala.reflect.macros.blackbox.Context): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(U: c.universe.Type): Nothing
number of parameter sections differ
def foo[U] = macro Impls11.foo[U]
^
@@ -73,13 +73,13 @@ Macros_Test_2.scala:46: error: type arguments [U] do not conform to method foo's
Macros_Test_2.scala:50: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String]
def foo[U <: Int] = macro Impls13.foo[U]
^
-Macros_Test_2.scala:54: error: macro implementation reference has too few type arguments for method foo: [U](c: scala.reflect.macros.BlackboxContext)(implicit evidence$4: c.WeakTypeTag[U])Nothing
+Macros_Test_2.scala:54: error: macro implementation reference has too few type arguments for method foo: [U](c: scala.reflect.macros.blackbox.Context)(implicit evidence$4: c.WeakTypeTag[U])Nothing
def foo = macro Impls14.foo
^
-Macros_Test_2.scala:59: error: macro implementation reference has too few type arguments for method foo: [T, U, V](c: scala.reflect.macros.BlackboxContext)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit]
+Macros_Test_2.scala:59: error: macro implementation reference has too few type arguments for method foo: [T, U, V](c: scala.reflect.macros.blackbox.Context)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit]
def foo15[V]: Unit = macro Impls15.foo
^
-Macros_Test_2.scala:60: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.BlackboxContext)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit]
+Macros_Test_2.scala:60: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.blackbox.Context)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit]
def foo16[V]: Unit = macro Impls16.foo[V]
^
16 errors found
View
30 test/files/neg/macro-invalidsig/Impls_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Impls1 {
- def foo[U: c.WeakTypeTag: Numeric](c: BlackboxContext) = { import c.universe._; q"42" }
+ def foo[U: c.WeakTypeTag: Numeric](c: Context) = { import c.universe._; q"42" }
}
object Impls2 {
@@ -14,15 +14,15 @@ object Impls3 {
}
object Impls4 {
- def foo(cs: BlackboxContext*) = ???
+ def foo(cs: Context*) = ???
}
object Impls5 {
- def foo(c: BlackboxContext) = ???
+ def foo(c: Context) = ???
}
object Impls6 {
- def foo[T, U: c.WeakTypeTag](c: BlackboxContext)(implicit x: c.Expr[Int]) = {
+ def foo[T, U: c.WeakTypeTag](c: Context)(implicit x: c.Expr[Int]) = {
import c.{prefix => prefix}
import c.universe._
c.Expr[Unit](q"""
@@ -34,39 +34,39 @@ object Impls6 {
}
object Impls7 {
- def foo(c: BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]) = ???
+ def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = ???
}
object Impls8 {
- def foo(c: BlackboxContext)(x: c.universe.Symbol) = ???
+ def foo(c: Context)(x: c.universe.Symbol) = ???
}
object Impls9 {
- def foo(c: BlackboxContext)(xs: c.Expr[Int]*) = ???
+ def foo(c: Context)(xs: c.Expr[Int]*) = ???
}
object Impls10 {
- def foo(c: BlackboxContext)(y: c.Expr[Int], x: c.Expr[Int]) = ???
+ def foo(c: Context)(y: c.Expr[Int], x: c.Expr[Int]) = ???
}
object Impls11 {
- def foo[U](c: BlackboxContext)(U: c.universe.Type) = ???
+ def foo[U](c: Context)(U: c.universe.Type) = ???
}
object Impls12 {
- def foo[U <: String](c: BlackboxContext) = ???
+ def foo[U <: String](c: Context) = ???
}
object Impls13 {
- def foo[U <: String](c: BlackboxContext) = ???
+ def foo[U <: String](c: Context) = ???
}
object Impls14 {
- def foo[U: c.WeakTypeTag](c: BlackboxContext) = ???
+ def foo[U: c.WeakTypeTag](c: Context) = ???
}
object Impls15 {
- def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: BlackboxContext)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = {
+ def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Context)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = {
import c.universe._
println(implicitly[c.WeakTypeTag[T]])
println(implicitly[c.WeakTypeTag[U]])
@@ -76,7 +76,7 @@ object Impls15 {
}
object Impls16 {
- def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: BlackboxContext)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = {
+ def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Context)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = {
import c.universe._
println(implicitly[c.WeakTypeTag[T]])
println(implicitly[c.WeakTypeTag[U]])
View
4 test/files/neg/macro-invalidusage-badargs/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(x: c.Expr[Int]) = x
+ def foo(c: Context)(x: c.Expr[Int]) = x
}
View
4 test/files/neg/macro-invalidusage-badbounds/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[U <: String](c: Ctx) = { import c.universe._; c.Expr[Unit](q"()") }
+ def foo[U <: String](c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
}
View
4 test/files/neg/macro-invalidusage-badtargs/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo