summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-01-14 00:34:24 -0800
committerJason Zaugg <jzaugg@gmail.com>2014-01-14 00:34:24 -0800
commitef4c5d2f43e912b5562c1372228e9c6ec9f25bb0 (patch)
treebb7385f1971d1b7869eed8678fb0bfef24082e60
parent4065b5136f2d0d1b6b9bb03f6669c1fd8a2b4e64 (diff)
parentb2f67b5730adccc4cbb24e5b542dc66452869489 (diff)
downloadscala-ef4c5d2f43e912b5562c1372228e9c6ec9f25bb0.tar.gz
scala-ef4c5d2f43e912b5562c1372228e9c6ec9f25bb0.tar.bz2
scala-ef4c5d2f43e912b5562c1372228e9c6ec9f25bb0.zip
Merge pull request #3355 from xeno-by/topic/saturday-night
reshuffles names for blackbox/whitebox contexts, changes bundle notation
-rw-r--r--src/compiler/scala/reflect/macros/compiler/Errors.scala2
-rw-r--r--src/compiler/scala/reflect/macros/compiler/Resolvers.scala35
-rw-r--r--src/compiler/scala/reflect/macros/compiler/Validators.scala18
-rw-r--r--src/compiler/scala/reflect/macros/contexts/Context.scala4
-rw-r--r--src/compiler/scala/reflect/macros/runtime/JavaReflectionRuntimes.scala15
-rw-r--r--src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala6
-rw-r--r--src/compiler/scala/reflect/macros/runtime/ScalaReflectionRuntimes.scala31
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala19
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Macros.scala16
-rw-r--r--src/partest-extras/scala/tools/partest/Util.scala4
-rw-r--r--src/reflect/scala/reflect/api/Exprs.scala2
-rw-r--r--src/reflect/scala/reflect/api/Importers.scala2
-rw-r--r--src/reflect/scala/reflect/api/Mirrors.scala6
-rw-r--r--src/reflect/scala/reflect/api/Universe.scala6
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala49
-rw-r--r--src/reflect/scala/reflect/macros/Aliases.scala4
-rw-r--r--src/reflect/scala/reflect/macros/BlackboxMacro.scala36
-rw-r--r--src/reflect/scala/reflect/macros/Enclosures.scala6
-rw-r--r--src/reflect/scala/reflect/macros/Evals.scala8
-rw-r--r--src/reflect/scala/reflect/macros/ExprUtils.scala4
-rw-r--r--src/reflect/scala/reflect/macros/FrontEnds.scala4
-rw-r--r--src/reflect/scala/reflect/macros/Infrastructure.scala4
-rw-r--r--src/reflect/scala/reflect/macros/Names.scala4
-rw-r--r--src/reflect/scala/reflect/macros/Parsers.scala4
-rw-r--r--src/reflect/scala/reflect/macros/Reifiers.scala4
-rw-r--r--src/reflect/scala/reflect/macros/Typers.scala6
-rw-r--r--src/reflect/scala/reflect/macros/WhiteboxMacro.scala36
-rw-r--r--src/reflect/scala/reflect/macros/blackbox/Context.scala (renamed from src/reflect/scala/reflect/macros/BlackboxContext.scala)29
-rw-r--r--src/reflect/scala/reflect/macros/package.scala8
-rw-r--r--src/reflect/scala/reflect/macros/whitebox/Context.scala (renamed from src/reflect/scala/reflect/macros/WhiteboxContext.scala)13
-rw-r--r--src/reflect/scala/reflect/runtime/JavaUniverseForce.scala2
-rw-r--r--src/reflect/scala/reflect/runtime/package.scala2
-rw-r--r--test/files/neg/macro-abort/Macros_1.scala4
-rw-r--r--test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala8
-rw-r--r--test/files/neg/macro-blackbox-dynamic-materialization/Macros_1.scala4
-rw-r--r--test/files/neg/macro-blackbox-extractor/Macros_1.scala4
-rw-r--r--test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala4
-rw-r--r--test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala2
-rw-r--r--test/files/neg/macro-bundle-abstract.check6
-rw-r--r--test/files/neg/macro-bundle-abstract.scala4
-rw-r--r--test/files/neg/macro-bundle-class.check4
-rw-r--r--test/files/neg/macro-bundle-class.scala11
-rw-r--r--test/files/neg/macro-bundle-mixbox.check4
-rw-r--r--test/files/neg/macro-bundle-mixbox.scala10
-rw-r--r--test/files/neg/macro-bundle-noncontext.check4
-rw-r--r--test/files/neg/macro-bundle-noncontext.scala (renamed from test/files/neg/macro-bundle-nonmacro.scala)2
-rw-r--r--test/files/neg/macro-bundle-nonmacro.check4
-rw-r--r--test/files/neg/macro-bundle-object.check4
-rw-r--r--test/files/neg/macro-bundle-object.scala6
-rw-r--r--test/files/neg/macro-bundle-overloaded.check4
-rw-r--r--test/files/neg/macro-bundle-overloaded.scala12
-rw-r--r--test/files/neg/macro-bundle-polymorphic.check10
-rw-r--r--test/files/neg/macro-bundle-polymorphic.scala12
-rw-r--r--test/files/neg/macro-bundle-trait.check2
-rw-r--r--test/files/neg/macro-bundle-trait.scala7
-rw-r--r--test/files/neg/macro-cyclic/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-divergence-controlled/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-exception/Macros_1.scala4
-rw-r--r--test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-incompatible-macro-engine/Macros_2.scala4
-rw-r--r--test/files/neg/macro-invalidimpl.check20
-rw-r--r--test/files/neg/macro-invalidimpl/Impls_1.scala20
-rw-r--r--test/files/neg/macro-invalidimpl/Macros_Test_2.scala4
-rw-r--r--test/files/neg/macro-invalidret.check12
-rw-r--r--test/files/neg/macro-invalidret/Impls_1.scala12
-rw-r--r--test/files/neg/macro-invalidshape/Impls_1.scala4
-rw-r--r--test/files/neg/macro-invalidshape/Macros_Test_2.scala2
-rw-r--r--test/files/neg/macro-invalidsig-params-badtype.check6
-rw-r--r--test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-invalidsig.check58
-rw-r--r--test/files/neg/macro-invalidsig/Impls_1.scala30
-rw-r--r--test/files/neg/macro-invalidusage-badargs/Impls_1.scala4
-rw-r--r--test/files/neg/macro-invalidusage-badbounds/Impls_1.scala4
-rw-r--r--test/files/neg/macro-invalidusage-badtargs/Impls_1.scala4
-rw-r--r--test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala4
-rw-r--r--test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-invalidusage-presuper/Impls_1.scala4
-rw-r--r--test/files/neg/macro-noexpand/Impls_1.scala4
-rw-r--r--test/files/neg/macro-nontypeablebody/Impls_1.scala4
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/macro-override-method-overrides-macro/Impls_1.scala12
-rw-r--r--test/files/neg/macro-quasiquotes/Macros_1.scala4
-rw-r--r--test/files/neg/macro-reify-splice-splice/Macros_1.scala4
-rw-r--r--test/files/neg/macro-without-xmacros-a/Impls_1.scala8
-rw-r--r--test/files/neg/macro-without-xmacros-b/Impls_1.scala8
-rw-r--r--test/files/neg/t5689.check6
-rw-r--r--test/files/neg/t5689.scala4
-rw-r--r--test/files/neg/t5753/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/t5753/Test_2.scala2
-rw-r--r--test/files/neg/t5903a/Macros_1.scala4
-rw-r--r--test/files/neg/t5903b/Macros_1.scala4
-rw-r--r--test/files/neg/t5903c/Macros_1.scala4
-rw-r--r--test/files/neg/t5903d/Macros_1.scala4
-rw-r--r--test/files/neg/t5903e/Macros_1.scala4
-rw-r--r--test/files/neg/t6123-explaintypes-macros.check6
-rw-r--r--test/files/neg/t6123-explaintypes-macros/BadMac_2.scala4
-rw-r--r--test/files/neg/t6123-explaintypes-macros/Macros.scala4
-rw-r--r--test/files/neg/t6539/Macro_1.scala4
-rw-r--r--test/files/neg/t7157/Impls_Macros_1.scala26
-rw-r--r--test/files/neg/t8104/Macros_1.scala4
-rw-r--r--test/files/pos/annotated-original/M_1.scala4
-rw-r--r--test/files/pos/annotated-treecopy/Impls_Macros_1.scala4
-rw-r--r--test/files/pos/attachments-typed-another-ident/Impls_1.scala4
-rw-r--r--test/files/pos/attachments-typed-ident/Impls_1.scala4
-rw-r--r--test/files/pos/macro-implicit-invalidate-on-error.scala2
-rw-r--r--test/files/pos/t5692a/Macros_1.scala4
-rw-r--r--test/files/pos/t5692b/Macros_1.scala4
-rw-r--r--test/files/pos/t5706.scala4
-rw-r--r--test/files/pos/t5744/Macros_1.scala6
-rw-r--r--test/files/pos/t6047.scala4
-rw-r--r--test/files/pos/t6447.scala8
-rw-r--r--test/files/pos/t6485a/Macros_1.scala4
-rw-r--r--test/files/pos/t6485b/Test.scala4
-rw-r--r--test/files/pos/t6516.scala6
-rw-r--r--test/files/pos/t7377/Macro_1.scala4
-rw-r--r--test/files/pos/t7461/Macros_1.scala4
-rw-r--r--test/files/pos/t7649.scala2
-rw-r--r--test/files/pos/t7776.scala2
-rw-r--r--test/files/pos/t8001/Macros_1.scala4
-rw-r--r--test/files/pos/t8013/inpervolator_1.scala2
-rw-r--r--test/files/pos/t8064/Macro_1.scala2
-rw-r--r--test/files/pos/t8064b/Macro_1.scala2
-rw-r--r--test/files/run/macro-abort-fresh/Macros_1.scala4
-rw-r--r--test/files/run/macro-auto-duplicate/Macros_1.scala4
-rw-r--r--test/files/run/macro-basic-ma-md-mi/Impls_1.scala8
-rw-r--r--test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala8
-rw-r--r--test/files/run/macro-basic-mamd-mi/Impls_1.scala8
-rw-r--r--test/files/run/macro-blackbox-materialization/Macros_1.scala4
-rw-r--r--test/files/run/macro-bodyexpandstoimpl/Impls_1.scala3
-rw-r--r--test/files/run/macro-bundle-repl.check12
-rw-r--r--test/files/run/macro-bundle-repl.scala6
-rw-r--r--test/files/run/macro-bundle-static/Impls_Macros_1.scala6
-rw-r--r--test/files/run/macro-bundle-static/Test_2.scala4
-rw-r--r--test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala6
-rw-r--r--test/files/run/macro-bundle-toplevel/Test_2.scala4
-rw-r--r--test/files/run/macro-bundle-whitebox.check6
-rw-r--r--test/files/run/macro-bundle-whitebox/Impls_Macros_1.scala26
-rw-r--r--test/files/run/macro-bundle-whitebox/Test_2.scala8
-rw-r--r--test/files/run/macro-def-path-dependent/Test_1.scala4
-rw-r--r--test/files/run/macro-def-path-dependent/Test_2.scala4
-rw-r--r--test/files/run/macro-def-path-dependent/Test_3.scala4
-rw-r--r--test/files/run/macro-def-path-dependent/Test_4.scala4
-rw-r--r--test/files/run/macro-def-path-dependent/Test_5.scala4
-rw-r--r--test/files/run/macro-def-path-dependent/Test_6.scala2
-rw-r--r--test/files/run/macro-default-params/Macros_1.scala4
-rw-r--r--test/files/run/macro-divergence-spurious/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-duplicate/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-enclosures/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-expand-implicit-argument/Macros_1.scala4
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-multiple-arglists/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-nullary-generic/Impls_1.scala12
-rw-r--r--test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala12
-rw-r--r--test/files/run/macro-expand-overload/Impls_1.scala12
-rw-r--r--test/files/run/macro-expand-override/Impls_1.scala12
-rw-r--r--test/files/run/macro-expand-recursive/Impls_1.scala6
-rw-r--r--test/files/run/macro-expand-tparams-bounds/Impls_1.scala6
-rw-r--r--test/files/run/macro-expand-tparams-explicit/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-tparams-implicit/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-tparams-prefix/Impls_1.scala8
-rw-r--r--test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala4
-rw-r--r--test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala4
-rw-r--r--test/files/run/macro-impl-default-params/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-impl-relaxed/Macros_1.scala10
-rw-r--r--test/files/run/macro-impl-rename-context/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala4
-rw-r--r--test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala4
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-openmacros/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-parse-position-malformed/Impls_Macros_1.scala5
-rw-r--r--test/files/run/macro-parse-position/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-quasiquotes/Macros_1.scala4
-rw-r--r--test/files/run/macro-range/Common_1.scala4
-rw-r--r--test/files/run/macro-range/Expansion_Impossible_2.scala4
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala4
-rw-r--r--test/files/run/macro-reify-basic/Macros_1.scala4
-rw-r--r--test/files/run/macro-reify-freevars/Macros_1.scala2
-rw-r--r--test/files/run/macro-reify-nested-a/Impls_Macros_1.scala8
-rw-r--r--test/files/run/macro-reify-nested-b/Impls_Macros_1.scala8
-rw-r--r--test/files/run/macro-reify-ref-to-packageless/Impls_1.scala4
-rw-r--r--test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-reify-staticXXX/Macros_1.scala6
-rw-r--r--test/files/run/macro-reify-tagful-a/Macros_1.scala4
-rw-r--r--test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-reify-type/Macros_1.scala4
-rw-r--r--test/files/run/macro-reify-unreify/Macros_1.scala4
-rw-r--r--test/files/run/macro-repl-basic.check10
-rw-r--r--test/files/run/macro-repl-basic.scala8
-rw-r--r--test/files/run/macro-repl-dontexpand.check8
-rw-r--r--test/files/run/macro-repl-dontexpand.scala4
-rw-r--r--test/files/run/macro-settings/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-sip19-revised/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-sip19/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-subpatterns/Macro_1.scala4
-rw-r--r--test/files/run/macro-system-properties.check8
-rw-r--r--test/files/run/macro-system-properties.scala4
-rw-r--r--test/files/run/macro-term-declared-in-annotation/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-anonymous/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-block/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-class-class/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-class-object/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-class/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-default-param/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-method/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-object-class/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-object-object/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-object/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-package-object/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-refinement/Impls_1.scala4
-rw-r--r--test/files/run/macro-term-declared-in-trait/Impls_1.scala4
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala6
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala6
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala6
-rw-r--r--test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala6
-rw-r--r--test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-vampire-false-warning/Macros_1.scala6
-rw-r--r--test/files/run/macro-whitebox-dynamic-materialization/Macros_1.scala4
-rw-r--r--test/files/run/macro-whitebox-extractor/Macros_1.scala4
-rw-r--r--test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala4
-rw-r--r--test/files/run/macro-whitebox-structural/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macroPlugins-macroArgs/Macros_2.scala4
-rw-r--r--test/files/run/macroPlugins-macroExpand/Macros_2.scala6
-rw-r--r--test/files/run/macroPlugins-macroRuntime/Macros_2.scala4
-rw-r--r--test/files/run/macroPlugins-typedMacroBody/Macros_2.scala6
-rw-r--r--test/files/run/repl-term-macros.check16
-rw-r--r--test/files/run/repl-term-macros.scala8
-rw-r--r--test/files/run/t5713/Impls_Macros_1.scala4
-rw-r--r--test/files/run/t5753_1/Impls_Macros_1.scala4
-rw-r--r--test/files/run/t5753_2/Impls_Macros_1.scala4
-rw-r--r--test/files/run/t5894.scala5
-rw-r--r--test/files/run/t5903a/Macros_1.scala4
-rw-r--r--test/files/run/t5903b/Macros_1.scala4
-rw-r--r--test/files/run/t5903c/Macros_1.scala4
-rw-r--r--test/files/run/t5903d/Macros_1.scala4
-rw-r--r--test/files/run/t5923a/Macros_1.scala4
-rw-r--r--test/files/run/t5923d/Macros_1.scala4
-rw-r--r--test/files/run/t5940.scala6
-rw-r--r--test/files/run/t6187.check10
-rw-r--r--test/files/run/t6187.scala4
-rw-r--r--test/files/run/t6221/Macros_1.scala4
-rw-r--r--test/files/run/t6381.check8
-rw-r--r--test/files/run/t6381.scala4
-rw-r--r--test/files/run/t6394a/Macros_1.scala4
-rw-r--r--test/files/run/t6394b/Macros_1.scala4
-rw-r--r--test/files/run/t6662/Macro_1.scala4
-rw-r--r--test/files/run/t6992/Macros_1.scala2
-rw-r--r--test/files/run/t7008-scala-defined/Impls_Macros_2.scala4
-rw-r--r--test/files/run/t7008/Impls_Macros_2.scala4
-rw-r--r--test/files/run/t7047/Impls_Macros_1.scala4
-rw-r--r--test/files/run/t7157/Impls_Macros_1.scala4
-rw-r--r--test/files/run/t7240/Macros_1.scala4
-rw-r--r--test/files/run/t7375b/Macros_1.scala4
-rw-r--r--test/files/run/t7617a/Macros_1.scala6
-rw-r--r--test/files/run/t7617b/Macros_1.scala4
-rw-r--r--test/files/run/t7657/Macros_1.scala4
-rw-r--r--test/files/run/t7777/Macros_1.scala4
-rw-r--r--test/files/run/t7871/Macros_1.scala2
-rw-r--r--test/files/run/t8048a/Macros_1.scala4
-rw-r--r--test/files/run/t8048b/Macros_1.scala8
-rw-r--r--test/files/run/t8104/Macros_1.scala4
-rw-r--r--test/files/run/toolbox_current_run_compiles.scala4
-rw-r--r--test/files/run/typed-annotated/Macros_1.scala4
-rw-r--r--test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala4
-rw-r--r--test/pending/run/macro-expand-default/Impls_1.scala4
-rw-r--r--test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala2
-rw-r--r--test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala4
-rw-r--r--test/pending/run/macro-expand-named/Impls_1.scala4
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala4
-rw-r--r--test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala4
-rw-r--r--test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala4
-rw-r--r--test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala2
-rw-r--r--test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala4
-rw-r--r--test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala2
-rw-r--r--test/pending/run/macro-reify-array/Macros_1.scala4
-rw-r--r--test/pending/run/macro-reify-tagful-b/Macros_1.scala4
-rw-r--r--test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala4
-rw-r--r--test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala4
-rw-r--r--test/scaladoc/run/SI-6812.scala4
-rw-r--r--test/scaladoc/run/SI-6812b.scala4
295 files changed, 834 insertions, 972 deletions
diff --git a/src/compiler/scala/reflect/macros/compiler/Errors.scala b/src/compiler/scala/reflect/macros/compiler/Errors.scala
index 4c30a9a85c..280baa2a42 100644
--- a/src/compiler/scala/reflect/macros/compiler/Errors.scala
+++ b/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 concrete classes having a single constructor with a `val c: Context` parameter")
// compatibility errors
diff --git a/src/compiler/scala/reflect/macros/compiler/Resolvers.scala b/src/compiler/scala/reflect/macros/compiler/Resolvers.scala
index e4851632a5..d35f1c32a9 100644
--- a/src/compiler/scala/reflect/macros/compiler/Resolvers.scala
+++ b/src/compiler/scala/reflect/macros/compiler/Resolvers.scala
@@ -40,36 +40,11 @@ trait Resolvers {
}
val untypedImplRef = typer.silent(_.typedTypeConstructor(maybeBundleRef)) match {
- case SilentResultValue(result) if mightBeMacroBundleType(result.tpe) =>
- val bundleProto = result.tpe.typeSymbol
- val bundlePkg = bundleProto.enclosingPackageClass
- 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`
- val bundlePid = gen.mkUnattributedRef(bundlePkg)
- val bundlePrefix =
- if (bundlePkg == EmptyPackageClass) bundleProto.fullName('$')
- else bundleProto.fullName('$').substring(bundlePkg.fullName('$').length + 1)
- val bundleName = TypeName(bundlePrefix + tpnme.MACRO_BUNDLE_SUFFIX)
- val existingBundle = bundleProto.enclosingPackageClass.info.decl(bundleName)
- if (!currentRun.compiles(existingBundle)) {
- val contextType = if (isBlackboxMacroBundleType(bundleProto.tpe)) BlackboxContextClass.tpe else WhiteboxContextClass.tpe
- def mkContextValDef(flags: Long) = ValDef(Modifiers(flags), nme.c, TypeTree(contextType), EmptyTree)
- val contextField = mkContextValDef(PARAMACCESSOR)
- val contextParam = mkContextValDef(PARAM | PARAMACCESSOR)
- val bundleCtor = DefDef(Modifiers(), nme.CONSTRUCTOR, Nil, List(List(contextParam)), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(()))))
- val bundleParent = gen.mkAppliedTypeTree(Ident(bundleProto), bundleProto.typeParams.map(sym => Ident(sym.name)))
- val bundleTemplate = Template(List(bundleParent), noSelfType, List(contextField, bundleCtor))
- val bundle = atPos(bundleProto.pos)(ClassDef(NoMods, bundleName, bundleProto.typeParams.map(TypeDef(_)), bundleTemplate))
- currentRun.compileLate(bundleName + ".scala", PackageDef(bundlePid, List(bundle)))
- }
-
- // synthesize the macro impl reference, which is going to look like:
- // `new FooBundle(???).macroName` plus the optional type arguments
- val bundleInstance = New(Select(bundlePid, bundleName), List(List(Ident(Predef_???))))
- atPos(macroDdef.rhs.pos)(gen.mkTypeApply(Select(bundleInstance, methName), targs))
+ case SilentResultValue(result) if looksLikeMacroBundleType(result.tpe) =>
+ val bundle = result.tpe.typeSymbol
+ if (!isMacroBundleType(bundle.tpe)) MacroBundleWrongShapeError()
+ if (!bundle.owner.isStaticOwner) MacroBundleNonStaticError()
+ atPos(macroDdef.rhs.pos)(gen.mkTypeApply(Select(New(bundle, Ident(Predef_???)), methName), targs))
case _ =>
macroDdef.rhs
}
diff --git a/src/compiler/scala/reflect/macros/compiler/Validators.scala b/src/compiler/scala/reflect/macros/compiler/Validators.scala
index 5936b52890..02c1f7c431 100644
--- a/src/compiler/scala/reflect/macros/compiler/Validators.scala
+++ b/src/compiler/scala/reflect/macros/compiler/Validators.scala
@@ -26,9 +26,9 @@ trait Validators {
if (macroImpl.isOverloaded) MacroImplOverloadedError()
val implicitParams = aparamss.flatten filter (_.isImplicit)
if (implicitParams.nonEmpty) MacroImplNonTagImplicitParameters(implicitParams)
- val declaredInStaticObject = isImplMethod && (macroImplOwner.isStaticOwner || macroImplOwner.moduleClass.isStaticOwner)
- val declaredInTopLevelClass = isImplBundle && macroImplOwner.owner.isPackageClass
- if (!declaredInStaticObject && !declaredInTopLevelClass) MacroImplReferenceWrongShapeError()
+ val effectiveOwner = if (isImplMethod) macroImplOwner else macroImplOwner.owner
+ val declaredInStaticObject = effectiveOwner.isStaticOwner || effectiveOwner.moduleClass.isStaticOwner
+ if (!declaredInStaticObject) MacroImplReferenceWrongShapeError()
}
private def checkMacroDefMacroImplCorrespondence() = {
@@ -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.
diff --git a/src/compiler/scala/reflect/macros/contexts/Context.scala b/src/compiler/scala/reflect/macros/contexts/Context.scala
index 7b79b52a18..87dac18849 100644
--- a/src/compiler/scala/reflect/macros/contexts/Context.scala
+++ b/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
diff --git a/src/compiler/scala/reflect/macros/runtime/JavaReflectionRuntimes.scala b/src/compiler/scala/reflect/macros/runtime/JavaReflectionRuntimes.scala
index 450cb4d9ea..ecdd48db22 100644
--- a/src/compiler/scala/reflect/macros/runtime/JavaReflectionRuntimes.scala
+++ b/src/compiler/scala/reflect/macros/runtime/JavaReflectionRuntimes.scala
@@ -2,7 +2,9 @@ package scala.reflect.macros
package runtime
import scala.reflect.runtime.ReflectionUtils
-import scala.reflect.macros.{Context => ApiContext}
+import scala.reflect.macros.blackbox.{Context => BlackboxContext}
+import scala.reflect.macros.whitebox.{Context => WhiteboxContext}
+import java.lang.reflect.{Constructor => jConstructor}
trait JavaReflectionRuntimes {
self: scala.tools.nsc.typechecker.Analyzer =>
@@ -19,8 +21,15 @@ trait JavaReflectionRuntimes {
macroLogVerbose(s"successfully loaded macro impl as ($implClass, $implMeth)")
args => {
val implObj =
- if (isBundle) implClass.getConstructor(classOf[ApiContext]).newInstance(args.c)
- else ReflectionUtils.staticSingletonInstance(implClass)
+ if (isBundle) {
+ def isMacroContext(clazz: Class[_]) = clazz == classOf[BlackboxContext] || clazz == classOf[WhiteboxContext]
+ def isBundleCtor(ctor: jConstructor[_]) = ctor.getParameterTypes match {
+ case Array(param) if isMacroContext(param) => true
+ case _ => false
+ }
+ val Array(bundleCtor) = implClass.getConstructors.filter(isBundleCtor)
+ bundleCtor.newInstance(args.c)
+ } else ReflectionUtils.staticSingletonInstance(implClass)
val implArgs = if (isBundle) args.others else args.c +: args.others
implMeth.invoke(implObj, implArgs.asInstanceOf[Seq[AnyRef]]: _*)
}
diff --git a/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala b/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala
index 14b0c6baba..5fd9c0db34 100644
--- a/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala
+++ b/src/compiler/scala/reflect/macros/runtime/MacroRuntimes.scala
@@ -4,7 +4,7 @@ package runtime
import scala.reflect.internal.Flags._
import scala.reflect.runtime.ReflectionUtils
-trait MacroRuntimes extends JavaReflectionRuntimes with ScalaReflectionRuntimes {
+trait MacroRuntimes extends JavaReflectionRuntimes {
self: scala.tools.nsc.typechecker.Analyzer =>
import global._
@@ -49,8 +49,7 @@ trait MacroRuntimes extends JavaReflectionRuntimes with ScalaReflectionRuntimes
/** Abstracts away resolution of macro runtimes.
*/
type MacroRuntime = MacroArgs => Any
- class MacroRuntimeResolver(val macroDef: Symbol) extends JavaReflectionResolvers
- with ScalaReflectionResolvers {
+ class MacroRuntimeResolver(val macroDef: Symbol) extends JavaReflectionResolvers {
val binding = loadMacroImplBinding(macroDef).get
val isBundle = binding.isBundle
val className = binding.className
@@ -63,7 +62,6 @@ trait MacroRuntimes extends JavaReflectionRuntimes with ScalaReflectionRuntimes
try {
macroLogVerbose(s"resolving macro implementation as $className.$methName (isBundle = $isBundle)")
macroLogVerbose(s"classloader is: ${ReflectionUtils.show(defaultMacroClassloader)}")
- // resolveScalaReflectionRuntime(defaultMacroClassloader)
resolveJavaReflectionRuntime(defaultMacroClassloader)
} catch {
case ex: Exception =>
diff --git a/src/compiler/scala/reflect/macros/runtime/ScalaReflectionRuntimes.scala b/src/compiler/scala/reflect/macros/runtime/ScalaReflectionRuntimes.scala
deleted file mode 100644
index 50f64310f8..0000000000
--- a/src/compiler/scala/reflect/macros/runtime/ScalaReflectionRuntimes.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-package scala.reflect.macros
-package runtime
-
-import scala.reflect.runtime.{universe => ru}
-
-trait ScalaReflectionRuntimes {
- self: scala.tools.nsc.typechecker.Analyzer =>
-
- trait ScalaReflectionResolvers {
- self: MacroRuntimeResolver =>
-
- def resolveScalaReflectionRuntime(classLoader: ClassLoader): MacroRuntime = {
- val macroMirror: ru.JavaMirror = ru.runtimeMirror(classLoader)
- val implContainerSym = macroMirror.classSymbol(Class.forName(className, true, classLoader))
- val implMethSym = implContainerSym.typeSignature.member(ru.TermName(methName)).asMethod
- macroLogVerbose(s"successfully loaded macro impl as ($implContainerSym, $implMethSym)")
- args => {
- val implContainer =
- if (isBundle) {
- val implCtorSym = implContainerSym.typeSignature.member(ru.nme.CONSTRUCTOR).asMethod
- macroMirror.reflectClass(implContainerSym).reflectConstructor(implCtorSym)(args.c)
- } else {
- macroMirror.reflectModule(implContainerSym.module.asModule).instance
- }
- val implMeth = macroMirror.reflect(implContainer).reflectMethod(implMethSym)
- val implArgs = if (isBundle) args.others else args.c +: args.others
- implMeth(implArgs: _*)
- }
- }
- }
-}
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 5f079a428b..5492e563dd 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -1710,25 +1710,6 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
}
- /** Create and compile a synthetic compilation unit from the provided tree.
- *
- * This needs to create a virtual file underlying the compilation unit in order to appease SBT.
- * However this file cannot have a randomly generated name, because then SBT 0.13 goes into a vicious loop
- * as described on the mailing list: https://groups.google.com/forum/#!msg/scala-user/r1SgSoVfs0U/Wv4av0LOKukJ
- * Therefore I have introduced an additional parameter that makes everyone specify meaningful file names.
- */
- def compileLate(virtualFileName: String, code: PackageDef) {
- // compatibility with SBT
- // on the one hand, we need to specify some jfile here, otherwise sbt crashes with an NPE (SI-6870)
- // on the other hand, we can't specify the obvious enclosingUnit, because then sbt somehow fails to run tests using type macros
- val fakeJfile = new java.io.File(virtualFileName)
- val virtualFile = new VirtualFile(virtualFileName) { override def file = fakeJfile }
- val sourceFile = new BatchSourceFile(virtualFile, code.toString)
- val unit = new CompilationUnit(sourceFile)
- unit.body = code
- compileLate(unit)
- }
-
/** Reset package class to state at typer (not sure what this
* is needed for?)
*/
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index fdec1edcc0..19fba639e3 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/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
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
index a1e77515a8..cf82d6baac 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala
+++ b/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
diff --git a/src/partest-extras/scala/tools/partest/Util.scala b/src/partest-extras/scala/tools/partest/Util.scala
index 8214396291..60e9dbb0f9 100644
--- a/src/partest-extras/scala/tools/partest/Util.scala
+++ b/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._
diff --git a/src/reflect/scala/reflect/api/Exprs.scala b/src/reflect/scala/reflect/api/Exprs.scala
index 50c8aa8779..5b6ff2325c 100644
--- a/src/reflect/scala/reflect/api/Exprs.scala
+++ b/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")
diff --git a/src/reflect/scala/reflect/api/Importers.scala b/src/reflect/scala/reflect/api/Importers.scala
index e239b86452..5667d93e29 100644
--- a/src/reflect/scala/reflect/api/Importers.scala
+++ b/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)
diff --git a/src/reflect/scala/reflect/api/Mirrors.scala b/src/reflect/scala/reflect/api/Mirrors.scala
index a4cd531053..0f0e2b81c9 100644
--- a/src/reflect/scala/reflect/api/Mirrors.scala
+++ b/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
diff --git a/src/reflect/scala/reflect/api/Universe.scala b/src/reflect/scala/reflect/api/Universe.scala
index 1da2c24306..1c9b77581a 100644
--- a/src/reflect/scala/reflect/api/Universe.scala
+++ b/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._
* ...
* }
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index 42c9135495..0091f50fc6 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -483,12 +483,8 @@ 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
- 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
- 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))
@@ -604,32 +600,31 @@ trait Definitions extends api.StandardDefinitions {
def isWhiteboxContextType(tp: Type) =
isMacroContextType(tp) && (tp <:< WhiteboxContextClass.tpe)
- def mightBeMacroBundleType(tp: Type) =
- tp.baseClasses.contains(WhiteboxMacroClass) ||
- tp.baseClasses.contains(BlackboxMacroClass)
-
- def isMacroBundleType(tp: Type) = tp.baseClasses match {
- case _ :: proto :: _ if isMacroBundleProtoType(proto.tpe) => true
- case _ => false
+ private def macroBundleParamInfo(tp: Type) = {
+ val ctor = tp.erasure.typeSymbol.primaryConstructor
+ ctor.paramss match {
+ case List(List(c)) =>
+ val sym = c.info.typeSymbol
+ val isContextCompatible = sym.isNonBottomSubClass(BlackboxContextClass) || sym.isNonBottomSubClass(WhiteboxContextClass)
+ if (isContextCompatible) c.info else NoType
+ case _ =>
+ NoType
+ }
}
- def isBlackboxMacroBundleType(tp: Type) =
- isMacroBundleType(tp) && (tp <:< BlackboxMacroClass.tpe) && !(tp <:< WhiteboxMacroClass.tpe)
+ def looksLikeMacroBundleType(tp: Type) =
+ macroBundleParamInfo(tp) != NoType
- def isMacroBundleProtoType(tp: Type) = {
- val sym = tp.typeSymbol
- val isNonTrivial = tp != ErrorType && tp != NothingTpe && tp != NullTpe
- def subclasses(sym: Symbol) = sym != NoSymbol && tp.baseClasses.contains(sym)
- val isMacroCompatible = subclasses(BlackboxMacroClass) ^ subclasses(WhiteboxMacroClass)
- val isBundlePrototype = sym != BlackboxMacroClass && sym != WhiteboxMacroClass && sym.isTrait && {
- val c = sym.info.member(nme.c)
- def overrides(sym: Symbol) = c.overrideChain.contains(sym)
- val cIsOk = (overrides(BlackboxMacroContextValue) || overrides(WhiteboxMacroContextValue)) && c.isDeferred
- cIsOk && sym.isMonomorphicType
- }
- isNonTrivial && isMacroCompatible && isBundlePrototype
+ def isMacroBundleType(tp: Type) = {
+ val isContextCompatible = macroBundleParamInfo(tp) != NoType
+ val hasSingleConstructor = !tp.declaration(nme.CONSTRUCTOR).isOverloaded
+ val nonAbstract = !tp.erasure.typeSymbol.isAbstractClass
+ isContextCompatible && hasSingleConstructor && nonAbstract
}
+ def isBlackboxMacroBundleType(tp: Type) =
+ isMacroBundleType(tp) && (macroBundleParamInfo(tp) <:< BlackboxContextClass.tpe)
+
def isIterableType(tp: Type) = tp <:< classExistentialType(IterableClass)
// These "direct" calls perform no dealiasing. They are most needed when
diff --git a/src/reflect/scala/reflect/macros/Aliases.scala b/src/reflect/scala/reflect/macros/Aliases.scala
index ca599dbd49..cc92cd10c7 100644
--- a/src/reflect/scala/reflect/macros/Aliases.scala
+++ b/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
diff --git a/src/reflect/scala/reflect/macros/BlackboxMacro.scala b/src/reflect/scala/reflect/macros/BlackboxMacro.scala
deleted file mode 100644
index df142e9238..0000000000
--- a/src/reflect/scala/reflect/macros/BlackboxMacro.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-package scala.reflect
-package macros
-
-/**
- * <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` .
- *
- * Instead of:
- *
- * def impl[T: c.WeakTypeTag](c: BlackboxContext)(x: c.Expr[Int]) = ...
- *
- * One can write:
- *
- * trait Impl extends BlackboxMacro {
- * def apply[T: c.WeakTypeTag](x: c.Expr[Int]) = ...
- * }
- *
- * Without changing anything else at all.
- *
- * This language feature is useful in itself in cases when macro implementations
- * 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`
- */
-trait BlackboxMacro {
- /** 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
-}
diff --git a/src/reflect/scala/reflect/macros/Enclosures.scala b/src/reflect/scala/reflect/macros/Enclosures.scala
index f3e934d12b..5f248d25d3 100644
--- a/src/reflect/scala/reflect/macros/Enclosures.scala
+++ b/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.
diff --git a/src/reflect/scala/reflect/macros/Evals.scala b/src/reflect/scala/reflect/macros/Evals.scala
index eb37e83cad..222ae43d79 100644
--- a/src/reflect/scala/reflect/macros/Evals.scala
+++ b/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
diff --git a/src/reflect/scala/reflect/macros/ExprUtils.scala b/src/reflect/scala/reflect/macros/ExprUtils.scala
index 58b61e446a..c438653c92 100644
--- a/src/reflect/scala/reflect/macros/ExprUtils.scala
+++ b/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")
diff --git a/src/reflect/scala/reflect/macros/FrontEnds.scala b/src/reflect/scala/reflect/macros/FrontEnds.scala
index 3a910d89ad..a770f325b2 100644
--- a/src/reflect/scala/reflect/macros/FrontEnds.scala
+++ b/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.
diff --git a/src/reflect/scala/reflect/macros/Infrastructure.scala b/src/reflect/scala/reflect/macros/Infrastructure.scala
index b6585f94d2..0f2d9ce4cf 100644
--- a/src/reflect/scala/reflect/macros/Infrastructure.scala
+++ b/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.
diff --git a/src/reflect/scala/reflect/macros/Names.scala b/src/reflect/scala/reflect/macros/Names.scala
index 6bd3e1a199..af60dffbfc 100644
--- a/src/reflect/scala/reflect/macros/Names.scala
+++ b/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")
diff --git a/src/reflect/scala/reflect/macros/Parsers.scala b/src/reflect/scala/reflect/macros/Parsers.scala
index 9d4a7e2953..720b754649 100644
--- a/src/reflect/scala/reflect/macros/Parsers.scala
+++ b/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.
diff --git a/src/reflect/scala/reflect/macros/Reifiers.scala b/src/reflect/scala/reflect/macros/Reifiers.scala
index 67d10dc10a..ff1f7a3b28 100644
--- a/src/reflect/scala/reflect/macros/Reifiers.scala
+++ b/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`.
diff --git a/src/reflect/scala/reflect/macros/Typers.scala b/src/reflect/scala/reflect/macros/Typers.scala
index 5a25801335..54336900f8 100644
--- a/src/reflect/scala/reflect/macros/Typers.scala
+++ b/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`
*/
diff --git a/src/reflect/scala/reflect/macros/WhiteboxMacro.scala b/src/reflect/scala/reflect/macros/WhiteboxMacro.scala
deleted file mode 100644
index 1c581313eb..0000000000
--- a/src/reflect/scala/reflect/macros/WhiteboxMacro.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-package scala.reflect
-package macros
-
-/**
- * <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` .
- *
- * Instead of:
- *
- * def impl[T: c.WeakTypeTag](c: WhiteboxContext)(x: c.Expr[Int]) = ...
- *
- * One can write:
- *
- * trait Impl extends WhiteboxMacro {
- * def apply[T: c.WeakTypeTag](x: c.Expr[Int]) = ...
- * }
- *
- * Without changing anything else at all.
- *
- * This language feature is useful in itself in cases when macro implementations
- * 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`
- */
-trait WhiteboxMacro {
- /** 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
-}
diff --git a/src/reflect/scala/reflect/macros/BlackboxContext.scala b/src/reflect/scala/reflect/macros/blackbox/Context.scala
index 2c77289866..05d9595c3a 100644
--- a/src/reflect/scala/reflect/macros/BlackboxContext.scala
+++ b/src/reflect/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)
diff --git a/src/reflect/scala/reflect/macros/package.scala b/src/reflect/scala/reflect/macros/package.scala
index 6a8434a163..cc7111d794 100644
--- a/src/reflect/scala/reflect/macros/package.scala
+++ b/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
} \ No newline at end of file
diff --git a/src/reflect/scala/reflect/macros/WhiteboxContext.scala b/src/reflect/scala/reflect/macros/whitebox/Context.scala
index 9d65a5c16e..bd48df46cc 100644
--- a/src/reflect/scala/reflect/macros/WhiteboxContext.scala
+++ b/src/reflect/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,
diff --git a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
index effb97b96d..b3b20a888e 100644
--- a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
+++ b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
@@ -320,8 +320,6 @@ trait JavaUniverseForce { self: runtime.JavaUniverse =>
definitions.MirrorClass
definitions.TypeCreatorClass
definitions.TreeCreatorClass
- definitions.BlackboxMacroClass
- definitions.WhiteboxMacroClass
definitions.BlackboxContextClass
definitions.WhiteboxContextClass
definitions.MacroImplAnnotation
diff --git a/src/reflect/scala/reflect/runtime/package.scala b/src/reflect/scala/reflect/runtime/package.scala
index 3a7688aa2c..3c9bbccba3 100644
--- a/src/reflect/scala/reflect/runtime/package.scala
+++ b/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")
diff --git a/test/files/neg/macro-abort/Macros_1.scala b/test/files/neg/macro-abort/Macros_1.scala
index 577e640089..2077e99ad7 100644
--- a/test/files/neg/macro-abort/Macros_1.scala
+++ b/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
diff --git a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala
index ae34815d37..325bb7276f 100644
--- a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala
+++ b/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")
}
diff --git a/test/files/neg/macro-blackbox-dynamic-materialization/Macros_1.scala b/test/files/neg/macro-blackbox-dynamic-materialization/Macros_1.scala
index a00d195005..3cfbdf45e9 100644
--- a/test/files/neg/macro-blackbox-dynamic-materialization/Macros_1.scala
+++ b/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]))
diff --git a/test/files/neg/macro-blackbox-extractor/Macros_1.scala b/test/files/neg/macro-blackbox-extractor/Macros_1.scala
index f0bfe53aa2..64b6270b74 100644
--- a/test/files/neg/macro-blackbox-extractor/Macros_1.scala
+++ b/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 {
diff --git a/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala b/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala
index 6bddef4b9d..a6f7de23bb 100644
--- a/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala
+++ b/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._
diff --git a/test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala b/test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala
index f5e85d57ea..a86a26d2c0 100644
--- a/test/files/neg/macro-blackbox-structural/Impls_Macros_1.scala
+++ b/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 {
diff --git a/test/files/neg/macro-bundle-abstract.check b/test/files/neg/macro-bundle-abstract.check
index 8ef59106b8..3afd079521 100644
--- a/test/files/neg/macro-bundle-abstract.check
+++ b/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 {
- ^
+macro-bundle-abstract.scala:10: error: macro bundles must be concrete classes having a single constructor with a `val c: Context` parameter
+ def foo = macro Bundle.impl
+ ^
one error found
diff --git a/test/files/neg/macro-bundle-abstract.scala b/test/files/neg/macro-bundle-abstract.scala
index f7778d03be..0afeaafc01 100644
--- a/test/files/neg/macro-bundle-abstract.scala
+++ b/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.Context
-trait Bundle extends BlackboxMacro {
+abstract class Bundle(c: Context) {
def deferred: Int
def impl = ???
}
diff --git a/test/files/neg/macro-bundle-class.check b/test/files/neg/macro-bundle-class.check
deleted file mode 100644
index 7108c15b8d..0000000000
--- a/test/files/neg/macro-bundle-class.check
+++ /dev/null
@@ -1,4 +0,0 @@
-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
- def foo = macro Bundle.impl
- ^
-one error found
diff --git a/test/files/neg/macro-bundle-class.scala b/test/files/neg/macro-bundle-class.scala
deleted file mode 100644
index 024e2dbaaa..0000000000
--- a/test/files/neg/macro-bundle-class.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
-import scala.reflect.macros.BlackboxContext
-
-class Bundle(val c: BlackboxContext) extends BlackboxMacro {
- def impl = ???
-}
-
-object Macros {
- def foo = macro Bundle.impl
-} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-mixbox.check b/test/files/neg/macro-bundle-mixbox.check
deleted file mode 100644
index c3136d9369..0000000000
--- a/test/files/neg/macro-bundle-mixbox.check
+++ /dev/null
@@ -1,4 +0,0 @@
-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
- def foo = macro Bundle.impl
- ^
-one error found
diff --git a/test/files/neg/macro-bundle-mixbox.scala b/test/files/neg/macro-bundle-mixbox.scala
deleted file mode 100644
index 1e36f3d94c..0000000000
--- a/test/files/neg/macro-bundle-mixbox.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-import scala.language.experimental.macros
-import scala.reflect.macros.{BlackboxMacro, WhiteboxMacro}
-
-trait Bundle extends BlackboxMacro with WhiteboxMacro {
- def impl = ???
-}
-
-object Macros {
- def foo = macro Bundle.impl
-} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-noncontext.check b/test/files/neg/macro-bundle-noncontext.check
new file mode 100644
index 0000000000..bb5d0851f5
--- /dev/null
+++ b/test/files/neg/macro-bundle-noncontext.check
@@ -0,0 +1,4 @@
+macro-bundle-noncontext.scala:8: error: not found: value Bundle
+ def foo = Bundle.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-bundle-nonmacro.scala b/test/files/neg/macro-bundle-noncontext.scala
index c7d99f4582..c228827e70 100644
--- a/test/files/neg/macro-bundle-nonmacro.scala
+++ b/test/files/neg/macro-bundle-noncontext.scala
@@ -1,6 +1,6 @@
import scala.language.experimental.macros
-trait Bundle {
+class Bundle {
def impl = ???
}
diff --git a/test/files/neg/macro-bundle-nonmacro.check b/test/files/neg/macro-bundle-nonmacro.check
deleted file mode 100644
index 5a265b5724..0000000000
--- a/test/files/neg/macro-bundle-nonmacro.check
+++ /dev/null
@@ -1,4 +0,0 @@
-macro-bundle-nonmacro.scala:8: error: not found: value Bundle
- def foo = Bundle.impl
- ^
-one error found
diff --git a/test/files/neg/macro-bundle-object.check b/test/files/neg/macro-bundle-object.check
index 78e7119fa7..b8800105f5 100644
--- a/test/files/neg/macro-bundle-object.check
+++ b/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
diff --git a/test/files/neg/macro-bundle-object.scala b/test/files/neg/macro-bundle-object.scala
index 105c81f1f5..6e1eec1686 100644
--- a/test/files/neg/macro-bundle-object.scala
+++ b/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.Context
-object Bundle extends BlackboxMacro {
- val c: BlackboxContext = ???
+object Bundle {
+ val c: Context = ???
def impl = ???
}
diff --git a/test/files/neg/macro-bundle-overloaded.check b/test/files/neg/macro-bundle-overloaded.check
new file mode 100644
index 0000000000..fc94ff0000
--- /dev/null
+++ b/test/files/neg/macro-bundle-overloaded.check
@@ -0,0 +1,4 @@
+macro-bundle-overloaded.scala:11: error: macro bundles must be concrete classes having a single constructor with a `val c: Context` parameter
+ def foo = macro Bundle.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-bundle-overloaded.scala b/test/files/neg/macro-bundle-overloaded.scala
new file mode 100644
index 0000000000..a4bc66f974
--- /dev/null
+++ b/test/files/neg/macro-bundle-overloaded.scala
@@ -0,0 +1,12 @@
+import scala.language.experimental.macros
+import scala.reflect.macros.blackbox.{Context => BlackboxContext}
+import scala.reflect.macros.whitebox.{Context => WhiteboxContext}
+
+class Bundle(val c: BlackboxContext) {
+ def this(c: WhiteboxContext) = this(c: BlackboxContext)
+ def impl = ???
+}
+
+object Macros {
+ def foo = macro Bundle.impl
+} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-polymorphic.check b/test/files/neg/macro-bundle-polymorphic.check
deleted file mode 100644
index e024fcde93..0000000000
--- a/test/files/neg/macro-bundle-polymorphic.check
+++ /dev/null
@@ -1,10 +0,0 @@
-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
- 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
- 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
- def foo = macro Bundle[Int, Nothing].impl
- ^
-three errors found
diff --git a/test/files/neg/macro-bundle-polymorphic.scala b/test/files/neg/macro-bundle-polymorphic.scala
deleted file mode 100644
index faf1e2e9e5..0000000000
--- a/test/files/neg/macro-bundle-polymorphic.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
-
-trait Bundle[T] extends BlackboxMacro {
- def impl = ???
-}
-
-object Macros {
- def foo = macro Bundle.impl
- def foo = macro Bundle[Int].impl
- def foo = macro Bundle[Int, Nothing].impl
-} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-trait.check b/test/files/neg/macro-bundle-trait.check
index 3cb7985013..869c67e1e3 100644
--- a/test/files/neg/macro-bundle-trait.check
+++ b/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: not found: value Bundle
def foo = macro Bundle.impl
^
one error found
diff --git a/test/files/neg/macro-bundle-trait.scala b/test/files/neg/macro-bundle-trait.scala
index 62ade49953..2aa63216f5 100644
--- a/test/files/neg/macro-bundle-trait.scala
+++ b/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.Context
-trait Bundle extends BlackboxMacro {
- val c: BlackboxContext = ???
+trait Bundle {
+ val c: Context = ???
def impl = ???
}
diff --git a/test/files/neg/macro-cyclic/Impls_Macros_1.scala b/test/files/neg/macro-cyclic/Impls_Macros_1.scala
index ba08345bcc..ad6890144d 100644
--- a/test/files/neg/macro-cyclic/Impls_Macros_1.scala
+++ b/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] }
}
diff --git a/test/files/neg/macro-divergence-controlled/Impls_Macros_1.scala b/test/files/neg/macro-divergence-controlled/Impls_Macros_1.scala
index 9fb374800b..186c285871 100644
--- a/test/files/neg/macro-divergence-controlled/Impls_Macros_1.scala
+++ b/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}) {
diff --git a/test/files/neg/macro-exception/Macros_1.scala b/test/files/neg/macro-exception/Macros_1.scala
index 7bd8415e4f..3d6109dc9d 100644
--- a/test/files/neg/macro-exception/Macros_1.scala
+++ b/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
diff --git a/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala b/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala
index 1bd808d55d..a97dfd4ddf 100644
--- a/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala
+++ b/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))
}
diff --git a/test/files/neg/macro-incompatible-macro-engine/Macros_2.scala b/test/files/neg/macro-incompatible-macro-engine/Macros_2.scala
index ad57a3cb36..39708eee49 100644
--- a/test/files/neg/macro-incompatible-macro-engine/Macros_2.scala
+++ b/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
} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl.check b/test/files/neg/macro-invalidimpl.check
index 5eff401bef..ea7d71c667 100644
--- a/test/files/neg/macro-invalidimpl.check
+++ b/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
^
diff --git a/test/files/neg/macro-invalidimpl/Impls_1.scala b/test/files/neg/macro-invalidimpl/Impls_1.scala
index b85ac9ee43..a1c885a4bf 100644
--- a/test/files/neg/macro-invalidimpl/Impls_1.scala
+++ b/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) = ???
}
} \ No newline at end of file
diff --git a/test/files/neg/macro-invalidimpl/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl/Macros_Test_2.scala
index 0df7d2e0c5..6760d99959 100644
--- a/test/files/neg/macro-invalidimpl/Macros_Test_2.scala
+++ b/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
diff --git a/test/files/neg/macro-invalidret.check b/test/files/neg/macro-invalidret.check
index 6c5baf76b4..99f29e57ce 100644
--- a/test/files/neg/macro-invalidret.check
+++ b/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
^
diff --git a/test/files/neg/macro-invalidret/Impls_1.scala b/test/files/neg/macro-invalidret/Impls_1.scala
index b32463899e..434aeef10f 100644
--- a/test/files/neg/macro-invalidret/Impls_1.scala
+++ b/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)))
}
diff --git a/test/files/neg/macro-invalidshape/Impls_1.scala b/test/files/neg/macro-invalidshape/Impls_1.scala
index 3d5da9a2ed..acc6b52b7b 100644
--- a/test/files/neg/macro-invalidshape/Impls_1.scala
+++ b/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]) = ???
}
diff --git a/test/files/neg/macro-invalidshape/Macros_Test_2.scala b/test/files/neg/macro-invalidshape/Macros_Test_2.scala
index 8f643ab281..160bbf5f53 100644
--- a/test/files/neg/macro-invalidshape/Macros_Test_2.scala
+++ b/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
}
diff --git a/test/files/neg/macro-invalidsig-params-badtype.check b/test/files/neg/macro-invalidsig-params-badtype.check
index d6b5c5521d..159754c72e 100644
--- a/test/files/neg/macro-invalidsig-params-badtype.check
+++ b/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
^
diff --git a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala
index 5f468424bd..e549cc9576 100644
--- a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala
+++ b/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 {
diff --git a/test/files/neg/macro-invalidsig.check b/test/files/neg/macro-invalidsig.check
index 5ff4ed18cb..8898ffc3de 100644
--- a/test/files/neg/macro-invalidsig.check
+++ b/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
diff --git a/test/files/neg/macro-invalidsig/Impls_1.scala b/test/files/neg/macro-invalidsig/Impls_1.scala
index 7c98160925..b0a3912380 100644
--- a/test/files/neg/macro-invalidsig/Impls_1.scala
+++ b/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]])
diff --git a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala
index 678cb53929..8765cfbd5f 100644
--- a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala
+++ b/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
}
diff --git a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala
index 393f7de976..1769da91e1 100644
--- a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala
+++ b/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"()") }
}
diff --git a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala
index 678cb53929..8765cfbd5f 100644
--- a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala
+++ b/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(c: Ctx)(x: c.Expr[Int]) = x
+ def foo(c: Context)(x: c.Expr[Int]) = x
}
diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala
index 15894efb68..776f8bf71c 100644
--- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala
+++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.universe._
c.Expr[Unit](q"""println("it works")""")
}
diff --git a/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala b/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala
index 44e508a1c6..b6b9611743 100644
--- a/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala
+++ b/test/files/neg/macro-invalidusage-nontypeable/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) = {
+ def foo(c: Context) = {
import c.universe._
val body = Ident(TermName("IDoNotExist"))
c.Expr[Int](body)
diff --git a/test/files/neg/macro-invalidusage-presuper/Impls_1.scala b/test/files/neg/macro-invalidusage-presuper/Impls_1.scala
index 02c87b5a81..ea98f01fa4 100644
--- a/test/files/neg/macro-invalidusage-presuper/Impls_1.scala
+++ b/test/files/neg/macro-invalidusage-presuper/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
} \ No newline at end of file
diff --git a/test/files/neg/macro-noexpand/Impls_1.scala b/test/files/neg/macro-noexpand/Impls_1.scala
index 3d5da9a2ed..acc6b52b7b 100644
--- a/test/files/neg/macro-noexpand/Impls_1.scala
+++ b/test/files/neg/macro-noexpand/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]) = ???
}
diff --git a/test/files/neg/macro-nontypeablebody/Impls_1.scala b/test/files/neg/macro-nontypeablebody/Impls_1.scala
index 3d5da9a2ed..acc6b52b7b 100644
--- a/test/files/neg/macro-nontypeablebody/Impls_1.scala
+++ b/test/files/neg/macro-nontypeablebody/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]) = ???
}
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala
index 9c05db83e3..916b454463 100644
--- a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: Ctx)(x: c.Expr[Int]) = x
+ def impl(c: Context)(x: c.Expr[Int]) = x
}
trait Foo {
diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala
index c98279b2b8..17827abf7a 100644
--- a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala
+++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
trait T { def t(): Unit }
trait A { def t(): Unit = () }
-object Macro { def t(c: BlackboxContext)(): c.Expr[Unit] = c.universe.reify(()) }
+object Macro { def t(c: Context)(): c.Expr[Unit] = c.universe.reify(()) }
trait C extends T { self: A => override def t(): Unit = macro Macro.t }
diff --git a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala
index f2d3f67ccc..f3917e3093 100644
--- a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala
+++ b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala
@@ -1,14 +1,14 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: Ctx)(tag: String, x: c.Expr[_]) = {
+ def impl(c: Context)(tag: String, x: c.Expr[_]) = {
import c.{prefix => prefix}
import c.universe._
c.Expr[Unit](q"println($tag, ${prefix.toString}, $x)")
}
- def fooBString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBString", x)
- def fooBInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBInt", x)
- def fooDInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooDInt", x)
- def fooZString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooZString", x)
+ def fooBString(c: Context)(x: c.Expr[_]) = impl(c)("fooBString", x)
+ def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x)
+ def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x)
+ def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x)
} \ No newline at end of file
diff --git a/test/files/neg/macro-quasiquotes/Macros_1.scala b/test/files/neg/macro-quasiquotes/Macros_1.scala
index 098e4b3b92..b123c475c2 100644
--- a/test/files/neg/macro-quasiquotes/Macros_1.scala
+++ b/test/files/neg/macro-quasiquotes/Macros_1.scala
@@ -1,7 +1,7 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
+import scala.reflect.macros.blackbox.Context
-trait Impls extends BlackboxMacro {
+class Impls(val c: Context) {
import c.universe._
def impl1(x: Expr[Int]) = q"println(x)"
def impl2(x: Tree) = q"println(x)"
diff --git a/test/files/neg/macro-reify-splice-splice/Macros_1.scala b/test/files/neg/macro-reify-splice-splice/Macros_1.scala
index 691f22ad07..306e78ad97 100644
--- a/test/files/neg/macro-reify-splice-splice/Macros_1.scala
+++ b/test/files/neg/macro-reify-splice-splice/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo = macro Impls.foo
object Impls {
- def foo(c: Ctx) = c.universe.reify {
+ def foo(c: Context) = c.universe.reify {
{ c.universe.reify(c.universe.reify("hello world")) }.splice.splice
}
}
diff --git a/test/files/neg/macro-without-xmacros-a/Impls_1.scala b/test/files/neg/macro-without-xmacros-a/Impls_1.scala
index 6b73a96184..035913f3e3 100644
--- a/test/files/neg/macro-without-xmacros-a/Impls_1.scala
+++ b/test/files/neg/macro-without-xmacros-a/Impls_1.scala
@@ -1,17 +1,17 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def foo_impl(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr(q"$x + 1")
}
- def bar_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def bar_impl(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr(q"$x + 2")
}
- def quux_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def quux_impl(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr(q"$x + 3")
}
diff --git a/test/files/neg/macro-without-xmacros-b/Impls_1.scala b/test/files/neg/macro-without-xmacros-b/Impls_1.scala
index 6b73a96184..035913f3e3 100644
--- a/test/files/neg/macro-without-xmacros-b/Impls_1.scala
+++ b/test/files/neg/macro-without-xmacros-b/Impls_1.scala
@@ -1,17 +1,17 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def foo_impl(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr(q"$x + 1")
}
- def bar_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def bar_impl(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr(q"$x + 2")
}
- def quux_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
+ def quux_impl(c: Context)(x: c.Expr[Int]): c.Expr[Int] = {
import c.universe._
c.Expr(q"$x + 3")
}
diff --git a/test/files/neg/t5689.check b/test/files/neg/t5689.check
index 9271f709ca..7d4f7fb63a 100644
--- a/test/files/neg/t5689.check
+++ b/test/files/neg/t5689.check
@@ -1,7 +1,7 @@
t5689.scala:4: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(i: c.Expr[Double]): c.Expr[String]
- or : (c: scala.reflect.macros.BlackboxContext)(i: c.Tree): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(i: c.Expr[Double]): c.Expr[Int]
+ required: (c: scala.reflect.macros.blackbox.Context)(i: c.Expr[Double]): c.Expr[String]
+ or : (c: scala.reflect.macros.blackbox.Context)(i: c.Tree): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(i: c.Expr[Double]): c.Expr[Int]
type mismatch for return type: c.Expr[Int] does not conform to c.Expr[String]
def returnsString(i: Double): String = macro returnsIntImpl
^
diff --git a/test/files/neg/t5689.scala b/test/files/neg/t5689.scala
index d0e468849d..d757a55417 100644
--- a/test/files/neg/t5689.scala
+++ b/test/files/neg/t5689.scala
@@ -1,6 +1,6 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
def returnsString(i: Double): String = macro returnsIntImpl
- def returnsIntImpl(c: BlackboxContext)(i: c.Expr[Double]): c.Expr[Int] = ???
+ def returnsIntImpl(c: Context)(i: c.Expr[Double]): c.Expr[Int] = ???
}
diff --git a/test/files/neg/t5753/Impls_Macros_1.scala b/test/files/neg/t5753/Impls_Macros_1.scala
index 0e81e21c77..9872c69171 100644
--- a/test/files/neg/t5753/Impls_Macros_1.scala
+++ b/test/files/neg/t5753/Impls_Macros_1.scala
@@ -1,6 +1,6 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
trait Impls {
- def impl(c: Ctx)(x: c.Expr[Any]) = x
+ def impl(c: Context)(x: c.Expr[Any]) = x
}
diff --git a/test/files/neg/t5753/Test_2.scala b/test/files/neg/t5753/Test_2.scala
index 150850a0eb..d52ed65c60 100644
--- a/test/files/neg/t5753/Test_2.scala
+++ b/test/files/neg/t5753/Test_2.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros extends Impls {
def foo(x: Any): Any = macro impl
diff --git a/test/files/neg/t5903a/Macros_1.scala b/test/files/neg/t5903a/Macros_1.scala
index ce1b035260..5d084ceed5 100644
--- a/test/files/neg/t5903a/Macros_1.scala
+++ b/test/files/neg/t5903a/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
trait Tree
@@ -13,7 +13,7 @@ object NewQuasiquotes {
}
object QuasiquoteMacros {
- def unapplyImpl(c: WhiteboxContext)(t: c.Tree) = {
+ def unapplyImpl(c: Context)(t: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/neg/t5903b/Macros_1.scala b/test/files/neg/t5903b/Macros_1.scala
index dfe9d8d489..6ce49c0228 100644
--- a/test/files/neg/t5903b/Macros_1.scala
+++ b/test/files/neg/t5903b/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl[T: c.WeakTypeTag](c: BlackboxContext)(x: c.Tree) = {
+ def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/neg/t5903c/Macros_1.scala b/test/files/neg/t5903c/Macros_1.scala
index d13c3c2ec2..4792f00454 100644
--- a/test/files/neg/t5903c/Macros_1.scala
+++ b/test/files/neg/t5903c/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl[T: c.WeakTypeTag](c: BlackboxContext)(x: c.Tree) = {
+ def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = {
import c.universe._
if (!(c.weakTypeOf[Int] =:= c.weakTypeOf[T])) c.abort(c.enclosingPosition, s"${c.weakTypeOf[T]} is not supported")
else {
diff --git a/test/files/neg/t5903d/Macros_1.scala b/test/files/neg/t5903d/Macros_1.scala
index 2d26e998a1..3500c2a782 100644
--- a/test/files/neg/t5903d/Macros_1.scala
+++ b/test/files/neg/t5903d/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl(c: BlackboxContext)(x: c.Tree) = {
+ def unapplyImpl(c: Context)(x: c.Tree) = {
import c.universe._
q"""
class Match(x: Int) {
diff --git a/test/files/neg/t5903e/Macros_1.scala b/test/files/neg/t5903e/Macros_1.scala
index 5bdc25b832..a64ff7e0b9 100644
--- a/test/files/neg/t5903e/Macros_1.scala
+++ b/test/files/neg/t5903e/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl(c: WhiteboxContext)(x: c.Tree) = {
+ def unapplyImpl(c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/neg/t6123-explaintypes-macros.check b/test/files/neg/t6123-explaintypes-macros.check
index ef545fcc32..2c86f3c9cc 100644
--- a/test/files/neg/t6123-explaintypes-macros.check
+++ b/test/files/neg/t6123-explaintypes-macros.check
@@ -1,9 +1,9 @@
c.universe.Expr[Any]* <: c.universe.Expr[String]*?
false
BadMac_2.scala:6: error: macro implementation has incompatible shape:
- required: (c: scala.reflect.macros.BlackboxContext)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit]
- or : (c: scala.reflect.macros.BlackboxContext)(format: c.Tree, params: Tree*): c.Tree
- found : (c: scala.reflect.macros.BlackboxContext)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit]
+ required: (c: scala.reflect.macros.blackbox.Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit]
+ or : (c: scala.reflect.macros.blackbox.Context)(format: c.Tree, params: Tree*): c.Tree
+ found : (c: scala.reflect.macros.blackbox.Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit]
type mismatch for parameter params: c.Expr[Any]* does not conform to c.Expr[String]*
def printf(format: String, params: Any*): Unit = macro printf_impl
^
diff --git a/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala
index 456e753893..75ded4ef7d 100644
--- a/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala
+++ b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala
@@ -1,8 +1,8 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
// explain some macro types to me
object BadMac {
def printf(format: String, params: Any*): Unit = macro printf_impl
- def printf_impl(c: BlackboxContext)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit] = ???
+ def printf_impl(c: Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit] = ???
}
diff --git a/test/files/neg/t6123-explaintypes-macros/Macros.scala b/test/files/neg/t6123-explaintypes-macros/Macros.scala
index cdcea34272..f2238b39a7 100644
--- a/test/files/neg/t6123-explaintypes-macros/Macros.scala
+++ b/test/files/neg/t6123-explaintypes-macros/Macros.scala
@@ -1,9 +1,9 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
def printf(format: String, params: Any*): Unit = macro printf_impl
- def printf_impl(c: BlackboxContext)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = ???
+ def printf_impl(c: Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = ???
}
// something trivial to run
diff --git a/test/files/neg/t6539/Macro_1.scala b/test/files/neg/t6539/Macro_1.scala
index 454489752c..60db669c46 100644
--- a/test/files/neg/t6539/Macro_1.scala
+++ b/test/files/neg/t6539/Macro_1.scala
@@ -1,9 +1,9 @@
import language.experimental.macros
-import reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object M {
def m(a: Any, b: Any): Any = macro mImpl
- def mImpl(c: BlackboxContext)(a: c.Expr[Any], b: c.Expr[Any]) = c.universe.reify(println(a.splice))
+ def mImpl(c: Context)(a: c.Expr[Any], b: c.Expr[Any]) = c.universe.reify(println(a.splice))
@reflect.internal.annotations.compileTimeOnly("cto may only be used as an argument to " + "m")
def cto = 0
diff --git a/test/files/neg/t7157/Impls_Macros_1.scala b/test/files/neg/t7157/Impls_Macros_1.scala
index 16cb001422..31d4d786d0 100644
--- a/test/files/neg/t7157/Impls_Macros_1.scala
+++ b/test/files/neg/t7157/Impls_Macros_1.scala
@@ -1,31 +1,31 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
- def impl1_0_0(c: BlackboxContext)() = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl1_1_1(c: BlackboxContext)(x: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl1_2_2(c: BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl1_0_0(c: Context)() = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl1_1_1(c: Context)(x: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl1_2_2(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
def m1_0_0() = macro impl1_0_0
def m1_1_1(x: Int) = macro impl1_1_1
def m1_2_2(x: Int, y: Int) = macro impl1_2_2
- def impl1_0_inf(c: BlackboxContext)(x: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl1_1_inf(c: BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl1_2_inf(c: BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl1_0_inf(c: Context)(x: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl1_1_inf(c: Context)(x: c.Expr[Int], y: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl1_2_inf(c: Context)(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
def m1_0_inf(x: Int*) = macro impl1_0_inf
def m1_1_inf(x: Int, y: Int*) = macro impl1_1_inf
def m1_2_inf(x: Int, y: Int, z: Int*) = macro impl1_2_inf
- def impl2_0_0(c: BlackboxContext)()() = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl2_1_1(c: BlackboxContext)()(x: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl2_2_2(c: BlackboxContext)()(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl2_0_0(c: Context)()() = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl2_1_1(c: Context)()(x: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl2_2_2(c: Context)()(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
def m2_0_0()() = macro impl2_0_0
def m2_1_1()(x: Int) = macro impl2_1_1
def m2_2_2()(x: Int, y: Int) = macro impl2_2_2
- def impl2_0_inf(c: BlackboxContext)()(x: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl2_1_inf(c: BlackboxContext)()(x: c.Expr[Int], y: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
- def impl2_2_inf(c: BlackboxContext)()(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl2_0_inf(c: Context)()(x: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl2_1_inf(c: Context)()(x: c.Expr[Int], y: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def impl2_2_inf(c: Context)()(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
def m2_0_inf()(x: Int*) = macro impl2_0_inf
def m2_1_inf()(x: Int, y: Int*) = macro impl2_1_inf
def m2_2_inf()(x: Int, y: Int, z: Int*) = macro impl2_2_inf
diff --git a/test/files/neg/t8104/Macros_1.scala b/test/files/neg/t8104/Macros_1.scala
index 21d81a3687..2ad4bc5a99 100644
--- a/test/files/neg/t8104/Macros_1.scala
+++ b/test/files/neg/t8104/Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Macros {
- def impl[T](c: WhiteboxContext)(implicit T: c.WeakTypeTag[T]) = {
+ def impl[T](c: Context)(implicit T: c.WeakTypeTag[T]) = {
import c.universe._
import definitions._
val fields = T.tpe.declarations.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x }
diff --git a/test/files/pos/annotated-original/M_1.scala b/test/files/pos/annotated-original/M_1.scala
index 089a3a13c5..e312f9abbf 100644
--- a/test/files/pos/annotated-original/M_1.scala
+++ b/test/files/pos/annotated-original/M_1.scala
@@ -1,7 +1,7 @@
import language.experimental.macros
-import reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object M {
- def impl(c: BlackboxContext)(a: c.Expr[Any]) = c.Expr[Any](c.resetLocalAttrs(a.tree))
+ def impl(c: Context)(a: c.Expr[Any]) = c.Expr[Any](c.resetLocalAttrs(a.tree))
def m(a: Any) = macro impl
}
diff --git a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
index 50c671707d..b02864b994 100644
--- a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
+++ b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
@@ -1,5 +1,5 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import collection.mutable.ListBuffer
import collection.mutable.Stack
@@ -12,7 +12,7 @@ object Macros {
def tree[T,U](f:Function1[T,U]): Function1[T,U] = macro tree_impl[T,U]
- def tree_impl[T:c.WeakTypeTag,U:c.WeakTypeTag](c: BlackboxContext)
+ def tree_impl[T:c.WeakTypeTag,U:c.WeakTypeTag](c: Context)
(f:c.Expr[Function1[T,U]]): c.Expr[Function1[T,U]] = {
import c.universe._
val ttag = c.weakTypeTag[U]
diff --git a/test/files/pos/attachments-typed-another-ident/Impls_1.scala b/test/files/pos/attachments-typed-another-ident/Impls_1.scala
index 6271359921..8016143a4c 100644
--- a/test/files/pos/attachments-typed-another-ident/Impls_1.scala
+++ b/test/files/pos/attachments-typed-another-ident/Impls_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object MyAttachment
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val ident = Ident(TermName("bar")) updateAttachment MyAttachment
assert(ident.attachments.get[MyAttachment.type].isDefined, ident.attachments)
diff --git a/test/files/pos/attachments-typed-ident/Impls_1.scala b/test/files/pos/attachments-typed-ident/Impls_1.scala
index f24ea88a5d..af2cc59ecd 100644
--- a/test/files/pos/attachments-typed-ident/Impls_1.scala
+++ b/test/files/pos/attachments-typed-ident/Impls_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object MyAttachment
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val ident = Ident(TermName("bar")) updateAttachment MyAttachment
assert(ident.attachments.get[MyAttachment.type].isDefined, ident.attachments)
diff --git a/test/files/pos/macro-implicit-invalidate-on-error.scala b/test/files/pos/macro-implicit-invalidate-on-error.scala
index f9756d965f..bb83e3cc38 100644
--- a/test/files/pos/macro-implicit-invalidate-on-error.scala
+++ b/test/files/pos/macro-implicit-invalidate-on-error.scala
@@ -1,5 +1,5 @@
import scala.language.experimental.macros
-import scala.reflect.macros.Context
+import scala.reflect.macros.blackbox.Context
trait LegacyLiftable[T] {
def apply(universe: scala.reflect.api.Universe, value: T): universe.Tree
diff --git a/test/files/pos/t5692a/Macros_1.scala b/test/files/pos/t5692a/Macros_1.scala
index 0e91f4d6a0..440e37d75d 100644
--- a/test/files/pos/t5692a/Macros_1.scala
+++ b/test/files/pos/t5692a/Macros_1.scala
@@ -1,6 +1,6 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl[T](c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def impl[T](c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
def foo[T] = macro impl[T]
} \ No newline at end of file
diff --git a/test/files/pos/t5692b/Macros_1.scala b/test/files/pos/t5692b/Macros_1.scala
index 1034a1ea4a..98fb882844 100644
--- a/test/files/pos/t5692b/Macros_1.scala
+++ b/test/files/pos/t5692b/Macros_1.scala
@@ -1,6 +1,6 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl[T, U](c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def impl[T, U](c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
def foo[T, U] = macro impl[T, U]
} \ No newline at end of file
diff --git a/test/files/pos/t5706.scala b/test/files/pos/t5706.scala
index 1970f5971f..6f0207366b 100644
--- a/test/files/pos/t5706.scala
+++ b/test/files/pos/t5706.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.BlackboxContext
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.blackbox.{Context => BlackboxContext}
+import scala.reflect.macros.whitebox.{Context => WhiteboxContext}
class Logger {
def error1(message: String) = macro Impls.error1
diff --git a/test/files/pos/t5744/Macros_1.scala b/test/files/pos/t5744/Macros_1.scala
index 0fc13c12d7..6e2bf4825b 100644
--- a/test/files/pos/t5744/Macros_1.scala
+++ b/test/files/pos/t5744/Macros_1.scala
@@ -1,18 +1,18 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo[U: Numeric](x: U) = macro foo_impl[U]
def bar[U: Numeric : Equiv, Y <% String](x: U)(implicit s: String) = macro bar_impl[U, Y]
- def foo_impl[U](c: BlackboxContext)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]]) = {
+ def foo_impl[U](c: Context)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]]) = {
import c.universe._
val plusOne = Apply(Select(numeric.tree, newTermName("plus")), List(x.tree, Literal(Constant(1))))
val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne))
c.Expr[Unit](body)
}
- def bar_impl[U, Y](c: BlackboxContext)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]], equiv: c.Expr[Equiv[U]], viewAsString: c.Expr[Y => String], s: c.Expr[String]) = {
+ def bar_impl[U, Y](c: Context)(x: c.Expr[U])(numeric: c.Expr[Numeric[U]], equiv: c.Expr[Equiv[U]], viewAsString: c.Expr[Y => String], s: c.Expr[String]) = {
import c.universe._
val plusOne = Apply(Select(numeric.tree, newTermName("plus")), List(x.tree, Literal(Constant(1))))
val plusLen = Apply(Select(numeric.tree, newTermName("plus")), List(plusOne, Select(s.tree, newTermName("length"))))
diff --git a/test/files/pos/t6047.scala b/test/files/pos/t6047.scala
index c5bb44d87e..8c3dd18953 100644
--- a/test/files/pos/t6047.scala
+++ b/test/files/pos/t6047.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import java.io.InputStream
object Macros {
def unpack[A](input: InputStream): A = macro unpack_impl[A]
- def unpack_impl[A: c.WeakTypeTag](c: BlackboxContext)(input: c.Expr[InputStream]): c.Expr[A] = {
+ def unpack_impl[A: c.WeakTypeTag](c: Context)(input: c.Expr[InputStream]): c.Expr[A] = {
import c.universe._
def unpackcode(tpe: c.Type): c.Expr[_] = {
diff --git a/test/files/pos/t6447.scala b/test/files/pos/t6447.scala
index 8203c0cddd..6ef69d4852 100644
--- a/test/files/pos/t6447.scala
+++ b/test/files/pos/t6447.scala
@@ -1,18 +1,18 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
class X { type T }
object X {
// this works
def foo(x: X): x.T = macro fooImpl
- def fooImpl(c: BlackboxContext)(x: c.Expr[X]): c.Expr[x.value.T] = ???
+ def fooImpl(c: Context)(x: c.Expr[X]): c.Expr[x.value.T] = ???
// this doesn't
def bar(x: X, y: X): (x.T, y.T) = macro barImpl
- def barImpl(c: BlackboxContext)(x: c.Expr[X], y: c.Expr[X]): c.Expr[(x.value.T, y.value.T)] = ???
+ def barImpl(c: Context)(x: c.Expr[X], y: c.Expr[X]): c.Expr[(x.value.T, y.value.T)] = ???
// neither does this
def baz(x: X)(xs: List[x.T]): Unit = macro bazImpl
- def bazImpl(c: BlackboxContext)(x: c.Expr[X])(xs: c.Expr[List[x.value.T]]): c.Expr[Unit] = ???
+ def bazImpl(c: Context)(x: c.Expr[X])(xs: c.Expr[List[x.value.T]]): c.Expr[Unit] = ???
}
diff --git a/test/files/pos/t6485a/Macros_1.scala b/test/files/pos/t6485a/Macros_1.scala
index c637c2cfee..570c987709 100644
--- a/test/files/pos/t6485a/Macros_1.scala
+++ b/test/files/pos/t6485a/Macros_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def crash(c: BlackboxContext): c.Expr[Unit] = c.universe.reify(())
+ def crash(c: Context): c.Expr[Unit] = c.universe.reify(())
} \ No newline at end of file
diff --git a/test/files/pos/t6485b/Test.scala b/test/files/pos/t6485b/Test.scala
index 9897987516..3b81c6f8ab 100644
--- a/test/files/pos/t6485b/Test.scala
+++ b/test/files/pos/t6485b/Test.scala
@@ -1,10 +1,10 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
final class Ops[T](val x: T) extends AnyVal {
def f = macro Macros.crash
}
object Macros {
- def crash(c: BlackboxContext): c.Expr[Unit] = c.universe.reify(())
+ def crash(c: Context): c.Expr[Unit] = c.universe.reify(())
} \ No newline at end of file
diff --git a/test/files/pos/t6516.scala b/test/files/pos/t6516.scala
index aed359976e..2980d83eb6 100644
--- a/test/files/pos/t6516.scala
+++ b/test/files/pos/t6516.scala
@@ -1,17 +1,17 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.collection.TraversableLike
// This one compiles
object Test {
- type Alias[T, CC[_]] = BlackboxContext { type PrefixType = TraversableLike[T, CC[T]] }
+ type Alias[T, CC[_]] = Context { type PrefixType = TraversableLike[T, CC[T]] }
def f() = macro f_impl
def f_impl(c: Alias[Int, List])() = ???
}
// This one doesn't
object Test2 {
- type Ctx = scala.reflect.macros.BlackboxContext
+ type Ctx = scala.reflect.macros.blackbox.Context
type Alias[T, CC[_]] = Ctx { type PrefixType = TraversableLike[T, CC[T]] }
def f() = macro f_impl
diff --git a/test/files/pos/t7377/Macro_1.scala b/test/files/pos/t7377/Macro_1.scala
index 7280cfeaf5..9f51248095 100644
--- a/test/files/pos/t7377/Macro_1.scala
+++ b/test/files/pos/t7377/Macro_1.scala
@@ -1,7 +1,7 @@
import language.experimental._
-import reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object M {
- def noopImpl[A](c: BlackboxContext)(expr: c.Expr[A]): c.Expr[A] = c.Expr(c.typecheck(c.resetLocalAttrs(expr.tree)))
+ def noopImpl[A](c: Context)(expr: c.Expr[A]): c.Expr[A] = c.Expr(c.typecheck(c.resetLocalAttrs(expr.tree)))
def noop[A](expr: A): A = macro noopImpl[A]
}
diff --git a/test/files/pos/t7461/Macros_1.scala b/test/files/pos/t7461/Macros_1.scala
index 89ae7c70e3..ca84d75624 100644
--- a/test/files/pos/t7461/Macros_1.scala
+++ b/test/files/pos/t7461/Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val wut = c.typecheck(Select(Literal(Constant(10)), newTermName("$minus")), silent = true)
// println(showRaw(wut, printIds = true, printTypes = true))
diff --git a/test/files/pos/t7649.scala b/test/files/pos/t7649.scala
index fa5d13369f..d70dc05ea4 100644
--- a/test/files/pos/t7649.scala
+++ b/test/files/pos/t7649.scala
@@ -1,5 +1,5 @@
object Test {
- val c: reflect.macros.BlackboxContext = ???
+ val c: scala.reflect.macros.blackbox.Context = ???
import c.universe._
reify {
// The lookup of the implicit WeakTypeTag[Any]
diff --git a/test/files/pos/t7776.scala b/test/files/pos/t7776.scala
index e0584b70e2..a36497a7a1 100644
--- a/test/files/pos/t7776.scala
+++ b/test/files/pos/t7776.scala
@@ -1,5 +1,5 @@
import scala.language.experimental.macros
-import scala.reflect.macros.Context
+import scala.reflect.macros.blackbox.Context
class MacroErasure {
def app(f: Any => Any, x: Any): Any = macro MacroErasure.appMacro
diff --git a/test/files/pos/t8001/Macros_1.scala b/test/files/pos/t8001/Macros_1.scala
index fd26016d4b..3b80b88295 100644
--- a/test/files/pos/t8001/Macros_1.scala
+++ b/test/files/pos/t8001/Macros_1.scala
@@ -1,9 +1,9 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo: Unit = macro impl
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
q"()"
}
diff --git a/test/files/pos/t8013/inpervolator_1.scala b/test/files/pos/t8013/inpervolator_1.scala
index fb71571afc..89b7c22709 100644
--- a/test/files/pos/t8013/inpervolator_1.scala
+++ b/test/files/pos/t8013/inpervolator_1.scala
@@ -4,7 +4,7 @@ package t8013
// perverse macro to confuse Xlint
import scala.language.experimental.macros
-import scala.reflect.macros.{ BlackboxContext => Context }
+import scala.reflect.macros.blackbox.Context
object Perverse {
diff --git a/test/files/pos/t8064/Macro_1.scala b/test/files/pos/t8064/Macro_1.scala
index 4fabd54a89..dd42950b34 100644
--- a/test/files/pos/t8064/Macro_1.scala
+++ b/test/files/pos/t8064/Macro_1.scala
@@ -1,5 +1,5 @@
import language.experimental.macros
-import scala.reflect.macros.Context
+import scala.reflect.macros.blackbox.Context
object Macro {
def apply(a: Any): Any = macro impl
diff --git a/test/files/pos/t8064b/Macro_1.scala b/test/files/pos/t8064b/Macro_1.scala
index 82582356c0..60996bfeca 100644
--- a/test/files/pos/t8064b/Macro_1.scala
+++ b/test/files/pos/t8064b/Macro_1.scala
@@ -1,5 +1,5 @@
import language.experimental.macros
-import scala.reflect.macros.Context
+import scala.reflect.macros.blackbox.Context
object Macro {
def apply(a: Any): Any = macro impl
diff --git a/test/files/run/macro-abort-fresh/Macros_1.scala b/test/files/run/macro-abort-fresh/Macros_1.scala
index 350d7b41aa..2b03512efb 100644
--- a/test/files/run/macro-abort-fresh/Macros_1.scala
+++ b/test/files/run/macro-abort-fresh/Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
println(c.fresh())
println(c.fresh("qwe"))
diff --git a/test/files/run/macro-auto-duplicate/Macros_1.scala b/test/files/run/macro-auto-duplicate/Macros_1.scala
index 255dafd47e..2c910e6af7 100644
--- a/test/files/run/macro-auto-duplicate/Macros_1.scala
+++ b/test/files/run/macro-auto-duplicate/Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val x = Ident(newTermName("x"))
def defAndUseX(rhs: Tree) = {
diff --git a/test/files/run/macro-basic-ma-md-mi/Impls_1.scala b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala
index c63353164e..fc75b99ef2 100644
--- a/test/files/run/macro-basic-ma-md-mi/Impls_1.scala
+++ b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala
@@ -1,19 +1,19 @@
-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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
c.Expr[Int](body)
}
- 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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))
c.Expr[Int](body)
}
- 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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))
c.Expr[Int](body)
diff --git a/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala
index 3cdd531316..73a5a971a4 100644
--- a/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala
+++ b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala
@@ -1,19 +1,19 @@
-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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
c.Expr[Int](body)
}
- 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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))
c.Expr[Int](body)
}
- 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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))
c.Expr[Int](body)
diff --git a/test/files/run/macro-basic-mamd-mi/Impls_1.scala b/test/files/run/macro-basic-mamd-mi/Impls_1.scala
index 3feddd2786..0be915c119 100644
--- a/test/files/run/macro-basic-mamd-mi/Impls_1.scala
+++ b/test/files/run/macro-basic-mamd-mi/Impls_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(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(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(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(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._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))
c.Expr[Int](body)
diff --git a/test/files/run/macro-blackbox-materialization/Macros_1.scala b/test/files/run/macro-blackbox-materialization/Macros_1.scala
index 7c31dd7dc2..ea8d1bed14 100644
--- a/test/files/run/macro-blackbox-materialization/Macros_1.scala
+++ b/test/files/run/macro-blackbox-materialization/Macros_1.scala
@@ -1,6 +1,6 @@
// For the full version of the test, take a look at run/t5923a
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
case class C[T](t: String)
@@ -9,7 +9,7 @@ object C {
}
object Macros {
- def impl[T: c.WeakTypeTag](c: BlackboxContext) = {
+ def impl[T: c.WeakTypeTag](c: Context) = {
import c.universe._
reify(C[T](c.literal(weakTypeOf[T].toString).splice))
}
diff --git a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala
index 8506239952..d46af4952d 100644
--- a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala
+++ b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala
@@ -1,5 +1,6 @@
import scala.language.experimental.macros
-import scala.reflect.macros.{BlackboxContext, WhiteboxContext}
+import scala.reflect.macros.blackbox.{Context => BlackboxContext}
+import scala.reflect.macros.whitebox.{Context => WhiteboxContext}
object Impls {
def foo(c: BlackboxContext)(x: c.Expr[Int]) = x
diff --git a/test/files/run/macro-bundle-repl.check b/test/files/run/macro-bundle-repl.check
index 8487042d66..4a0b421606 100644
--- a/test/files/run/macro-bundle-repl.check
+++ b/test/files/run/macro-bundle-repl.check
@@ -4,17 +4,17 @@ Type :help for more information.
scala> import scala.language.experimental.macros
import scala.language.experimental.macros
-scala> import scala.reflect.macros.BlackboxMacro
-import scala.reflect.macros.BlackboxMacro
+scala> import scala.reflect.macros.blackbox.Context
+import scala.reflect.macros.blackbox.Context
-scala> trait Bar extends BlackboxMacro { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl
-defined trait Bar
+scala> class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl
+defined class Bar
defined term macro bar: Unit
scala> bar
-scala> trait Foo extends BlackboxMacro { def impl = { import c.universe._; c.Expr[Unit](q"()") } }
-defined trait Foo
+scala> class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } }
+defined class Foo
scala> def foo: Unit = macro Foo.impl
defined term macro foo: Unit
diff --git a/test/files/run/macro-bundle-repl.scala b/test/files/run/macro-bundle-repl.scala
index db64f05943..8084418454 100644
--- a/test/files/run/macro-bundle-repl.scala
+++ b/test/files/run/macro-bundle-repl.scala
@@ -3,10 +3,10 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code = """
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
-trait Bar extends BlackboxMacro { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl
+import scala.reflect.macros.blackbox.Context
+class Bar(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } };def bar: Unit = macro Bar.impl
bar
-trait Foo extends BlackboxMacro { def impl = { import c.universe._; c.Expr[Unit](q"()") } }
+class Foo(val c: Context) { def impl = { import c.universe._; c.Expr[Unit](q"()") } }
def foo: Unit = macro Foo.impl
foo
"""
diff --git a/test/files/run/macro-bundle-static/Impls_Macros_1.scala b/test/files/run/macro-bundle-static/Impls_Macros_1.scala
index b859411325..0142e5d945 100644
--- a/test/files/run/macro-bundle-static/Impls_Macros_1.scala
+++ b/test/files/run/macro-bundle-static/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.BlackboxMacro
+import scala.reflect.macros.blackbox.Context
import scala.language.experimental.macros
object Enclosing {
- trait Impl extends BlackboxMacro {
+ class Impl(val c: Context) {
def mono = { import c.universe._; c.Expr[Unit](q"()") }
def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") }
def weird = macro mono
@@ -16,7 +16,7 @@ object Macros {
package pkg {
object Enclosing {
- trait Impl extends BlackboxMacro {
+ class Impl(val c: Context) {
def mono = { import c.universe._; c.Expr[Boolean](q"true") }
def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") }
def weird = macro mono
diff --git a/test/files/run/macro-bundle-static/Test_2.scala b/test/files/run/macro-bundle-static/Test_2.scala
index 72160f6ec2..e35260cdce 100644
--- a/test/files/run/macro-bundle-static/Test_2.scala
+++ b/test/files/run/macro-bundle-static/Test_2.scala
@@ -1,8 +1,8 @@
object Test extends App {
println(Macros.mono)
println(Macros.poly[Int])
- println(new Enclosing.Impl{val c = ???}.weird)
+ println(new Enclosing.Impl(???).weird)
println(pkg.Macros.mono)
println(pkg.Macros.poly[Int])
- println(new pkg.Enclosing.Impl{val c = ???}.weird)
+ println(new pkg.Enclosing.Impl(???).weird)
} \ No newline at end of file
diff --git a/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala b/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala
index e026768642..6fd7be3b25 100644
--- a/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala
+++ b/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala
@@ -1,6 +1,6 @@
-import scala.reflect.macros.BlackboxMacro
+import scala.reflect.macros.blackbox.Context
-trait Impl extends BlackboxMacro {
+class Impl(val c: Context) {
def mono = { import c.universe._; c.Expr[Unit](q"()") }
def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") }
def weird = macro mono
@@ -12,7 +12,7 @@ object Macros {
}
package pkg {
- trait Impl extends BlackboxMacro {
+ class Impl(val c: Context) {
def mono = { import c.universe._; c.Expr[Boolean](q"true") }
def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") }
def weird = macro mono
diff --git a/test/files/run/macro-bundle-toplevel/Test_2.scala b/test/files/run/macro-bundle-toplevel/Test_2.scala
index 139cc5bef2..195fb49262 100644
--- a/test/files/run/macro-bundle-toplevel/Test_2.scala
+++ b/test/files/run/macro-bundle-toplevel/Test_2.scala
@@ -1,8 +1,8 @@
object Test extends App {
println(Macros.mono)
println(Macros.poly[Int])
- println(new Impl{val c = ???}.weird)
+ println(new Impl(???).weird)
println(pkg.Macros.mono)
println(pkg.Macros.poly[Int])
- println(new pkg.Impl{val c = ???}.weird)
+ println(new pkg.Impl(???).weird)
} \ No newline at end of file
diff --git a/test/files/run/macro-bundle-whitebox.check b/test/files/run/macro-bundle-whitebox.check
new file mode 100644
index 0000000000..37c8eaf27a
--- /dev/null
+++ b/test/files/run/macro-bundle-whitebox.check
@@ -0,0 +1,6 @@
+()
+Int
+()
+true
+IntInt
+true
diff --git a/test/files/run/macro-bundle-whitebox/Impls_Macros_1.scala b/test/files/run/macro-bundle-whitebox/Impls_Macros_1.scala
new file mode 100644
index 0000000000..5e1b11895d
--- /dev/null
+++ b/test/files/run/macro-bundle-whitebox/Impls_Macros_1.scala
@@ -0,0 +1,26 @@
+import scala.language.experimental.macros
+import scala.reflect.macros.whitebox.Context
+
+class Impl(val c: Context) {
+ def mono = { import c.universe._; c.Expr[Unit](q"()") }
+ def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString}") }
+ def weird = macro mono
+}
+
+object Macros {
+ def mono = macro Impl.mono
+ def poly[T] = macro Impl.poly[T]
+}
+
+package pkg {
+ class Impl(val c: Context) {
+ def mono = { import c.universe._; c.Expr[Boolean](q"true") }
+ def poly[T: c.WeakTypeTag] = { import c.universe._; c.Expr[String](q"${c.weakTypeOf[T].toString + c.weakTypeOf[T].toString}") }
+ def weird = macro mono
+ }
+
+ object Macros {
+ def mono = macro Impl.mono
+ def poly[T] = macro Impl.poly[T]
+ }
+} \ No newline at end of file
diff --git a/test/files/run/macro-bundle-whitebox/Test_2.scala b/test/files/run/macro-bundle-whitebox/Test_2.scala
new file mode 100644
index 0000000000..195fb49262
--- /dev/null
+++ b/test/files/run/macro-bundle-whitebox/Test_2.scala
@@ -0,0 +1,8 @@
+object Test extends App {
+ println(Macros.mono)
+ println(Macros.poly[Int])
+ println(new Impl(???).weird)
+ println(pkg.Macros.mono)
+ println(pkg.Macros.poly[Int])
+ println(new pkg.Impl(???).weird)
+} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent/Test_1.scala b/test/files/run/macro-def-path-dependent/Test_1.scala
index bba97fcae1..4161a64303 100644
--- a/test/files/run/macro-def-path-dependent/Test_1.scala
+++ b/test/files/run/macro-def-path-dependent/Test_1.scala
@@ -2,7 +2,7 @@
// package test1
//
-// import scala.reflect.macros.{BlackboxContext => Ctx}
+// import scala.reflect.macros.blackbox.Context
//
// trait Exprs {
// self: Universe =>
@@ -21,5 +21,5 @@
// trait Universe extends Exprs with Reifiers
//
// object Impls {
-// def reify[T](cc: Ctx{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+// def reify[T](cc: Context{ type PrefixType = Reifiers })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
// }
diff --git a/test/files/run/macro-def-path-dependent/Test_2.scala b/test/files/run/macro-def-path-dependent/Test_2.scala
index c884ab9d0b..75a03b54e7 100644
--- a/test/files/run/macro-def-path-dependent/Test_2.scala
+++ b/test/files/run/macro-def-path-dependent/Test_2.scala
@@ -1,6 +1,6 @@
package test2
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
trait Exprs {
self: Universe =>
@@ -18,5 +18,5 @@ trait Universe extends Exprs with Reifiers {
}
object Impls {
- def reify[T](cc: Ctx{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+ def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
}
diff --git a/test/files/run/macro-def-path-dependent/Test_3.scala b/test/files/run/macro-def-path-dependent/Test_3.scala
index 6d856d1450..1a5da8200b 100644
--- a/test/files/run/macro-def-path-dependent/Test_3.scala
+++ b/test/files/run/macro-def-path-dependent/Test_3.scala
@@ -1,6 +1,6 @@
package test3
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
trait Exprs {
self: Universe =>
@@ -18,5 +18,5 @@ trait Universe extends Exprs with Reifiers {
}
object Impls {
- def reify[T](cc: Ctx{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
+ def reify[T](cc: Context{ type PrefixType = Universe })(expr: cc.Expr[T]): cc.Expr[cc.prefix.value.Expr[T]] = ???
}
diff --git a/test/files/run/macro-def-path-dependent/Test_4.scala b/test/files/run/macro-def-path-dependent/Test_4.scala
index 6562802013..67cb88ee6f 100644
--- a/test/files/run/macro-def-path-dependent/Test_4.scala
+++ b/test/files/run/macro-def-path-dependent/Test_4.scala
@@ -1,11 +1,11 @@
package test4
import scala.reflect.runtime.universe._
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.reflect.api.Universe
object Test {
def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro materializeTypeTag_impl[T]
- def materializeTypeTag_impl[T: c.WeakTypeTag](c: BlackboxContext)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
+ def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent/Test_5.scala b/test/files/run/macro-def-path-dependent/Test_5.scala
index 22407b850c..b518ce864c 100644
--- a/test/files/run/macro-def-path-dependent/Test_5.scala
+++ b/test/files/run/macro-def-path-dependent/Test_5.scala
@@ -1,9 +1,9 @@
package test56
import scala.reflect.runtime.universe._
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.reflect.api.Universe
object Impls {
- def materializeTypeTag_impl[T: c.WeakTypeTag](c: BlackboxContext)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
+ def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ???
} \ No newline at end of file
diff --git a/test/files/run/macro-def-path-dependent/Test_6.scala b/test/files/run/macro-def-path-dependent/Test_6.scala
index 011e726b3f..a8b50ce7d2 100644
--- a/test/files/run/macro-def-path-dependent/Test_6.scala
+++ b/test/files/run/macro-def-path-dependent/Test_6.scala
@@ -1,7 +1,7 @@
package test56
import scala.reflect.runtime.universe._
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.reflect.api.Universe
object Macros {
diff --git a/test/files/run/macro-default-params/Macros_1.scala b/test/files/run/macro-default-params/Macros_1.scala
index 47780ea4b8..74588a1cf4 100644
--- a/test/files/run/macro-default-params/Macros_1.scala
+++ b/test/files/run/macro-default-params/Macros_1.scala
@@ -1,11 +1,11 @@
import scala.language.experimental.macros
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Macros {
def id[A]: A = null.asInstanceOf[A]
def foo: Any = macro impl
- def impl(c: WhiteboxContext): c.Tree = {
+ def impl(c: Context): c.Tree = {
import c.universe._
import Flag._
diff --git a/test/files/run/macro-divergence-spurious/Impls_Macros_1.scala b/test/files/run/macro-divergence-spurious/Impls_Macros_1.scala
index 4bafa84128..85d0f0bb7e 100644
--- a/test/files/run/macro-divergence-spurious/Impls_Macros_1.scala
+++ b/test/files/run/macro-divergence-spurious/Impls_Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
trait Complex[T]
@@ -7,7 +7,7 @@ class Foo(val bar: Bar)
class Bar(val s: String)
object Complex {
- def impl[T: c.WeakTypeTag](c: BlackboxContext): 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}) {
diff --git a/test/files/run/macro-duplicate/Impls_Macros_1.scala b/test/files/run/macro-duplicate/Impls_Macros_1.scala
index ab852c9e46..84fb2c5b61 100644
--- a/test/files/run/macro-duplicate/Impls_Macros_1.scala
+++ b/test/files/run/macro-duplicate/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) = {
import c.universe._
val Expr(Block((cdef: ClassDef) :: Nil, _)) = reify { class C { def x = 2 } }
val cdef1 =
diff --git a/test/files/run/macro-enclosures/Impls_Macros_1.scala b/test/files/run/macro-enclosures/Impls_Macros_1.scala
index dfffb48e73..5b04cf29e9 100644
--- a/test/files/run/macro-enclosures/Impls_Macros_1.scala
+++ b/test/files/run/macro-enclosures/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) = {
import c.universe._
reify {
println("enclosingPackage = " + c.Expr[String](Literal(Constant(c.enclosingPackage.toString))).splice)
diff --git a/test/files/run/macro-expand-implicit-argument/Macros_1.scala b/test/files/run/macro-expand-implicit-argument/Macros_1.scala
index 7ac30e3ff2..465f313ef2 100644
--- a/test/files/run/macro-expand-implicit-argument/Macros_1.scala
+++ b/test/files/run/macro-expand-implicit-argument/Macros_1.scala
@@ -5,7 +5,7 @@ import scala.{specialized => spec}
import language.experimental.macros
import scala.reflect.ClassTag
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
def alloc[@spec A:ClassTag](src:Array[A], s1:Int, len:Int) = {
@@ -35,7 +35,7 @@ object Macros {
* arr
* }
*/
- def arrayMacro[A:c.WeakTypeTag](c:BlackboxContext)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = {
+ def arrayMacro[A:c.WeakTypeTag](c:Context)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = {
import c.mirror._
import c.universe._
def const(x:Int) = Literal(Constant(x))
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
index c56489e61c..18c97956e4 100644
--- a/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_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: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(x.tree))
c.Expr[Unit](body)
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala
index f93d9100e8..aeceee5a5b 100644
--- a/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_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: c.Expr[String]): c.Expr[Option[Int]] = {
+ def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = {
import c.universe._
val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt"))))
c.Expr[Option[Int]](body)
diff --git a/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala
index a8b478e9f2..fd267d32c4 100644
--- a/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.universe._
val body = Literal(Constant(2))
c.Expr[Int](body)
diff --git a/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala
index f93d9100e8..aeceee5a5b 100644
--- a/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-view/Impls_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: c.Expr[String]): c.Expr[Option[Int]] = {
+ def foo(c: Context)(x: c.Expr[String]): c.Expr[Option[Int]] = {
import c.universe._
val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt"))))
c.Expr[Option[Int]](body)
diff --git a/test/files/run/macro-expand-multiple-arglists/Impls_1.scala b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala
index bc3d768a67..9278633c11 100644
--- a/test/files/run/macro-expand-multiple-arglists/Impls_1.scala
+++ b/test/files/run/macro-expand-multiple-arglists/Impls_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: c.Expr[Int])(y: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = {
import c.universe._
val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
diff --git a/test/files/run/macro-expand-nullary-generic/Impls_1.scala b/test/files/run/macro-expand-nullary-generic/Impls_1.scala
index e0a048046f..9362d6c17a 100644
--- a/test/files/run/macro-expand-nullary-generic/Impls_1.scala
+++ b/test/files/run/macro-expand-nullary-generic/Impls_1.scala
@@ -1,15 +1,15 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl[T: c.WeakTypeTag](c: Ctx)(meth: String) = {
+ def impl[T: c.WeakTypeTag](c: Context)(meth: String) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(s"$meth[${c.weakTypeOf[T]}]"))))
c.Expr[Unit](body)
}
- def fooNullary[T: c.WeakTypeTag](c: Ctx) = impl[T](c)("fooNullary")
- def fooEmpty[T: c.WeakTypeTag](c: Ctx)() = impl[T](c)("fooEmpty")
- def barNullary[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c)("barNullary")
- def barEmpty[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c)("barEmpty")
+ def fooNullary[T: c.WeakTypeTag](c: Context) = impl[T](c)("fooNullary")
+ def fooEmpty[T: c.WeakTypeTag](c: Context)() = impl[T](c)("fooEmpty")
+ def barNullary[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = impl[T](c)("barNullary")
+ def barEmpty[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int])() = impl[T](c)("barEmpty")
} \ No newline at end of file
diff --git a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
index 5da33babd3..c8c3d255c4 100644
--- a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
+++ b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala
@@ -1,15 +1,15 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: Ctx)(meth: String) = {
+ def impl(c: Context)(meth: String) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth))))
c.Expr[Unit](body)
}
- def fooNullary(c: Ctx) = impl(c)("fooNullary")
- def fooEmpty(c: Ctx)() = impl(c)("fooEmpty")
- def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c)("barNullary")
- def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c)("barEmpty")
+ def fooNullary(c: Context) = impl(c)("fooNullary")
+ def fooEmpty(c: Context)() = impl(c)("fooEmpty")
+ def barNullary(c: Context)(x: c.Expr[Int]) = impl(c)("barNullary")
+ def barEmpty(c: Context)(x: c.Expr[Int])() = impl(c)("barEmpty")
} \ No newline at end of file
diff --git a/test/files/run/macro-expand-overload/Impls_1.scala b/test/files/run/macro-expand-overload/Impls_1.scala
index ea68e9eb93..ef9d01d4ed 100644
--- a/test/files/run/macro-expand-overload/Impls_1.scala
+++ b/test/files/run/macro-expand-overload/Impls_1.scala
@@ -1,15 +1,15 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: Ctx)(tag: String, x: c.Expr[_]) = {
+ def impl(c: Context)(tag: String, x: c.Expr[_]) = {
import c.{prefix => prefix}
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree))
c.Expr[Unit](body)
}
- def fooObjectString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooObjectString", x)
- def fooObjectInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooObjectInt", x)
- def fooClassString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooClassString", x)
- def fooClassInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooClassInt", x)
+ def fooObjectString(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectString", x)
+ def fooObjectInt(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectInt", x)
+ def fooClassString(c: Context)(x: c.Expr[_]) = impl(c)("fooClassString", x)
+ def fooClassInt(c: Context)(x: c.Expr[_]) = impl(c)("fooClassInt", x)
} \ No newline at end of file
diff --git a/test/files/run/macro-expand-override/Impls_1.scala b/test/files/run/macro-expand-override/Impls_1.scala
index 648641f578..e6ce18f172 100644
--- a/test/files/run/macro-expand-override/Impls_1.scala
+++ b/test/files/run/macro-expand-override/Impls_1.scala
@@ -1,15 +1,15 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: Ctx)(tag: String, x: c.Expr[_]) = {
+ def impl(c: Context)(tag: String, x: c.Expr[_]) = {
import c.{prefix => prefix}
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree))
c.Expr[Unit](body)
}
- def fooBString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBString", x)
- def fooBInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooBInt", x)
- def fooDInt(c: Ctx)(x: c.Expr[_]) = impl(c)("fooDInt", x)
- def fooZString(c: Ctx)(x: c.Expr[_]) = impl(c)("fooZString", x)
+ def fooBString(c: Context)(x: c.Expr[_]) = impl(c)("fooBString", x)
+ def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x)
+ def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x)
+ def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x)
} \ No newline at end of file
diff --git a/test/files/run/macro-expand-recursive/Impls_1.scala b/test/files/run/macro-expand-recursive/Impls_1.scala
index 8ba1a24540..3def2d2fbe 100644
--- a/test/files/run/macro-expand-recursive/Impls_1.scala
+++ b/test/files/run/macro-expand-recursive/Impls_1.scala
@@ -1,13 +1,13 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))
c.Expr[Unit](body)
}
- def fooFoo(c: Ctx) = {
+ def fooFoo(c: Context) = {
import c.universe._
val body = Select(Ident(TermName("Macros")), TermName("foo"))
c.Expr[Unit](body)
diff --git a/test/files/run/macro-expand-tparams-bounds/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds/Impls_1.scala
index a255072774..95aaa1c3d7 100644
--- a/test/files/run/macro-expand-tparams-bounds/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-bounds/Impls_1.scala
@@ -1,12 +1,12 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Impls1 {
- def foo[U <: String](c: BlackboxContext): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") }
+ def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") }
}
class C
class D extends C
object Impls2 {
- def foo[U <: C](c: BlackboxContext): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") }
+ def foo[U <: C](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello")""") }
}
diff --git a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala
index e95d61a36a..c33ac6d1b7 100644
--- a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[U: c.WeakTypeTag](c: Ctx) = {
+ def foo[U: c.WeakTypeTag](c: Context) = {
import c.universe._
val U = implicitly[c.WeakTypeTag[U]]
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString))))
diff --git a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala
index 37cf785c0d..32cee0d5fb 100644
--- a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = {
+ def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = {
import c.universe._
val U = implicitly[c.WeakTypeTag[U]]
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString))))
diff --git a/test/files/run/macro-expand-tparams-prefix/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix/Impls_1.scala
index 8f85ffff4a..289f07162b 100644
--- a/test/files/run/macro-expand-tparams-prefix/Impls_1.scala
+++ b/test/files/run/macro-expand-tparams-prefix/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](c: BlackboxContext)(x: c.Expr[U]) = {
+ def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = {
import c.universe._
val U = implicitly[c.WeakTypeTag[U]]
c.Expr[Unit](q"println(${U.toString})")
@@ -10,7 +10,7 @@ object Impls1 {
}
object Impls2 {
- def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: BlackboxContext)(x: c.Expr[U]) = {
+ def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = {
import c.universe._
val T = implicitly[c.WeakTypeTag[T]]
val U = implicitly[c.WeakTypeTag[U]]
@@ -20,7 +20,7 @@ object Impls2 {
}
object Impls345 {
- def foo[T, U: c.WeakTypeTag, V](c: BlackboxContext)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = {
+ def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = {
import c.universe._
c.Expr(q"""
println(${T.toString})
diff --git a/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala b/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala
index 7bfff374e2..64f16c6a89 100644
--- a/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala
+++ b/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala
@@ -1,11 +1,11 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Helper {
def unapplySeq[T](x: List[T]): Option[Seq[T]] = List.unapplySeq[T](x)
}
object Macros {
- def impl[T: c.WeakTypeTag](c: WhiteboxContext)(x: c.Expr[List[T]]) = {
+ def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[List[T]]) = {
c.universe.reify(Helper.unapplySeq(x.splice))
}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala
index 2480af61ad..18af84583a 100644
--- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ def foo(c: Context)(xs: c.Expr[Int]*) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList)
c.Expr[Unit](body)
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala
index a31c92a01c..4bdc5bec00 100644
--- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ def foo(c: Context)(xs: c.Expr[Int]*) = {
import c.universe._
val stripped_xs = xs map (_.tree) toList match {
case List(Typed(stripped, Ident(wildstar))) if wildstar == tpnme.WILDCARD_STAR => List(stripped)
diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala
index 889240d628..64ab7de02a 100644
--- a/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala
+++ b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala
@@ -1,11 +1,11 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
def myprintln(xs: Int*) = {
println(xs)
}
- def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ def foo(c: Context)(xs: c.Expr[Int]*) = {
import c.universe._
val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList)
c.Expr[Unit](body)
diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala
index 2480af61ad..18af84583a 100644
--- a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala
+++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ def foo(c: Context)(xs: c.Expr[Int]*) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList)
c.Expr[Unit](body)
diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala
index 889240d628..64ab7de02a 100644
--- a/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala
+++ b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala
@@ -1,11 +1,11 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
def myprintln(xs: Int*) = {
println(xs)
}
- def foo(c: Ctx)(xs: c.Expr[Int]*) = {
+ def foo(c: Context)(xs: c.Expr[Int]*) = {
import c.universe._
val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList)
c.Expr[Unit](body)
diff --git a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
index aa76a410ea..9b1d0eed35 100644
--- a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
+++ b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo_targs[T, U: c.WeakTypeTag](c: Ctx = null)(x: c.Expr[Int] = null) = {
+ def foo_targs[T, U: c.WeakTypeTag](c: Context = null)(x: c.Expr[Int] = null) = {
import c.{prefix => prefix}
import c.universe._
val U = implicitly[c.WeakTypeTag[U]]
diff --git a/test/files/run/macro-impl-relaxed/Macros_1.scala b/test/files/run/macro-impl-relaxed/Macros_1.scala
index 3cf5090ec8..420eb2a399 100644
--- a/test/files/run/macro-impl-relaxed/Macros_1.scala
+++ b/test/files/run/macro-impl-relaxed/Macros_1.scala
@@ -1,11 +1,11 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def implUU(c: BlackboxContext)(x: c.Tree): c.Tree = x
- def implTU(c: BlackboxContext)(x: c.Expr[Int]): c.Tree = x.tree
- def implUT(c: BlackboxContext)(x: c.Tree): c.Expr[Int] = c.Expr[Int](x)
- def implTT(c: BlackboxContext)(x: c.Expr[Int]): c.Expr[Int] = x
+ def implUU(c: Context)(x: c.Tree): c.Tree = x
+ def implTU(c: Context)(x: c.Expr[Int]): c.Tree = x.tree
+ def implUT(c: Context)(x: c.Tree): c.Expr[Int] = c.Expr[Int](x)
+ def implTT(c: Context)(x: c.Expr[Int]): c.Expr[Int] = x
def fooUU(x: Int): Int = macro implUU
def fooTU(x: Int): Int = macro implTU
diff --git a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
index c79fc30628..acc47fcde6 100644
--- a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
+++ b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(unconventionalName: Ctx)(x: unconventionalName.Expr[Int]) = {
+ def foo(unconventionalName: Context)(x: unconventionalName.Expr[Int]) = {
import unconventionalName.universe._
unconventionalName.Expr[Unit](q"""println("invoking foo...")""")
}
diff --git a/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala b/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala
index 55cf0dcafa..705defb18f 100644
--- a/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala
+++ b/test/files/run/macro-impl-tparam-only-in-impl/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): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
+ def foo[U <: String](c: Context): c.Expr[Unit] = { import c.universe._; c.Expr[Unit](q"""println("hello world")""") }
}
diff --git a/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala b/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala
index bcc746e39a..fc72e7a979 100644
--- a/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala
+++ b/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[U](c: Ctx) = {
+ def foo[U](c: Context) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("don't know U"))))
c.Expr[Unit](body)
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
index 5a51d27b24..603500b597 100644
--- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/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): c.Expr[Int] = {
+ def foo(c: Context): c.Expr[Int] = {
import c.universe._
c.Expr(Literal(Constant("42")))
}
diff --git a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
index 44e508a1c6..b6b9611743 100644
--- a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidret-nontypeable/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) = {
+ def foo(c: Context) = {
import c.universe._
val body = Ident(TermName("IDoNotExist"))
c.Expr[Int](body)
diff --git a/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala
index a54eaa4001..0d4c5755f0 100644
--- a/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidusage-badret/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: c.Expr[Int]) = x
+ def foo(c: Context)(x: c.Expr[Int]) = x
}
object Macros {
diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
index a67a296335..8b5c59bde8 100644
--- a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[T]) = {
+ def foo[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString))))
c.Expr[Unit](body)
diff --git a/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala
index 88929df27a..6970b4dd7e 100644
--- a/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidusage-partialapplication/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: c.Expr[Int])(y: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = {
import c.universe._
val sum = Apply(Select(x.tree, TermName("$plus")), List(y.tree))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
diff --git a/test/files/run/macro-openmacros/Impls_Macros_1.scala b/test/files/run/macro-openmacros/Impls_Macros_1.scala
index 22e94f32cd..b60ca90d91 100644
--- a/test/files/run/macro-openmacros/Impls_Macros_1.scala
+++ b/test/files/run/macro-openmacros/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): c.Expr[Unit] = {
+ def impl(c: Context): c.Expr[Unit] = {
// we're macros, so we can reflect against our source path
// so we don't need any partests to clean up after us!
val dir = c.enclosingUnit.source.file.file.getCanonicalFile.getParentFile
diff --git a/test/files/run/macro-parse-position-malformed/Impls_Macros_1.scala b/test/files/run/macro-parse-position-malformed/Impls_Macros_1.scala
index 2417eb6897..b623d8820a 100644
--- a/test/files/run/macro-parse-position-malformed/Impls_Macros_1.scala
+++ b/test/files/run/macro-parse-position-malformed/Impls_Macros_1.scala
@@ -1,8 +1,9 @@
import scala.language.experimental.macros
-import scala.reflect.macros.{Context => Ctx, ParseException}
+import scala.reflect.macros.blackbox.Context
+import scala.reflect.macros.ParseException
object Macros {
- def impl(c: Ctx)() = {
+ def impl(c: Context)() = {
import c.universe._
val out = try {
c.parse("foo(bar")
diff --git a/test/files/run/macro-parse-position/Impls_Macros_1.scala b/test/files/run/macro-parse-position/Impls_Macros_1.scala
index 92f64a8e70..dd20fd291b 100644
--- a/test/files/run/macro-parse-position/Impls_Macros_1.scala
+++ b/test/files/run/macro-parse-position/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
import scala.language.experimental.macros
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: Ctx)() = {
+ def impl(c: Context)() = {
import c.universe._
val t = c.parse("foo bar")
val out = s"${t.pos == NoPosition}\n${t.pos}\n${t.pos.source.content.length}\n${new String(t.pos.source.content)}"
diff --git a/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala b/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala
index 04aa11b8fe..df189b70d3 100644
--- a/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala
+++ b/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
object Impls {
- def foo(c: Ctx)(x: c.Expr[Any]) = x
+ def foo(c: Context)(x: c.Expr[Any]) = x
}
def foo(x: Any) = macro Impls.foo
diff --git a/test/files/run/macro-quasiquotes/Macros_1.scala b/test/files/run/macro-quasiquotes/Macros_1.scala
index 81775d98e8..764542a870 100644
--- a/test/files/run/macro-quasiquotes/Macros_1.scala
+++ b/test/files/run/macro-quasiquotes/Macros_1.scala
@@ -1,7 +1,7 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxMacro
+import scala.reflect.macros.blackbox.Context
-trait Impls extends BlackboxMacro {
+class Impls(val c: Context) {
import c.universe._
def impl1 = q"println(1)"
def impl2 = q"{ println(2); println(3) }"
diff --git a/test/files/run/macro-range/Common_1.scala b/test/files/run/macro-range/Common_1.scala
index 1ad2a6c6eb..0e66815f15 100644
--- a/test/files/run/macro-range/Common_1.scala
+++ b/test/files/run/macro-range/Common_1.scala
@@ -1,4 +1,4 @@
-import reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
abstract class RangeDefault {
val from, to: Int
@@ -10,7 +10,7 @@ abstract class RangeDefault {
/** This class should go into reflect.macro once it is a bit more stable. */
abstract class Utils {
- val context: BlackboxContext
+ val context: Context
import context.universe._
class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer {
diff --git a/test/files/run/macro-range/Expansion_Impossible_2.scala b/test/files/run/macro-range/Expansion_Impossible_2.scala
index fa869a2569..514de6864a 100644
--- a/test/files/run/macro-range/Expansion_Impossible_2.scala
+++ b/test/files/run/macro-range/Expansion_Impossible_2.scala
@@ -1,7 +1,7 @@
-import reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foreach(c: BlackboxContext)(f: c.Expr[Int => Unit]): c.Expr[Unit] = {
+ def foreach(c: Context)(f: c.Expr[Int => Unit]): c.Expr[Unit] = {
// todo. read the compiler config and print if -Ydebug is set
//println("macro-expand, _this = "+ _this)
object utils extends Utils { val context: c.type = c }
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala
index 53b96691e9..e964da2106 100644
--- a/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala
+++ b/test/files/run/macro-reflective-ma-normal-mdmi/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: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
c.Expr[Int](body)
diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala b/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala
index 81ad5cae0b..89a818d99c 100644
--- a/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala
+++ b/test/files/run/macro-reflective-mamd-normal-mi/Impls_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: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
c.Expr[Int](body)
diff --git a/test/files/run/macro-reify-basic/Macros_1.scala b/test/files/run/macro-reify-basic/Macros_1.scala
index e1a6d8abfb..1cf2a8a406 100644
--- a/test/files/run/macro-reify-basic/Macros_1.scala
+++ b/test/files/run/macro-reify-basic/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo(s: String) = macro Impls.foo
object Impls {
- def foo(c: Ctx)(s: c.Expr[String]) = c.universe.reify {
+ def foo(c: Context)(s: c.Expr[String]) = c.universe.reify {
println("hello " + s.splice)
}
}
diff --git a/test/files/run/macro-reify-freevars/Macros_1.scala b/test/files/run/macro-reify-freevars/Macros_1.scala
index 2cd94f600a..912f602c6c 100644
--- a/test/files/run/macro-reify-freevars/Macros_1.scala
+++ b/test/files/run/macro-reify-freevars/Macros_1.scala
@@ -2,7 +2,7 @@ package scala.collection.slick
object QueryableMacros{
def map[T:c.WeakTypeTag, S:c.WeakTypeTag]
- (c: scala.reflect.macros.BlackboxContext)
+ (c: scala.reflect.macros.blackbox.Context)
(projection: c.Expr[T => S])
: c.Expr[scala.collection.slick.Queryable[S]] = {
import c.universe._
diff --git a/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala
index 8f7a34a10a..8d2aa1e70a 100644
--- a/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala
+++ b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
-case class Utils[C <: BlackboxContext]( c:C ) {
+case class Utils[C <: Context]( c:C ) {
import c.universe._
import c.{Tree=>_}
object removeDoubleReify extends c.universe.Transformer {
@@ -21,7 +21,7 @@ case class Utils[C <: BlackboxContext]( c:C ) {
}
}
object QueryableMacros{
- def _helper[C <: BlackboxContext,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = {
+ def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = {
import c.universe._
import treeBuild._
val element_type = implicitly[c.WeakTypeTag[S]].tpe
@@ -34,7 +34,7 @@ object QueryableMacros{
c.universe.reify{ Queryable.factory[S]( foo.splice )}
}
def map[T:c.WeakTypeTag, S:c.WeakTypeTag]
- (c: scala.reflect.macros.BlackboxContext)
+ (c: scala.reflect.macros.blackbox.Context)
(projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection )
}
class Queryable[T]{
diff --git a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala
index 8f7a34a10a..8d2aa1e70a 100644
--- a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala
+++ b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
-case class Utils[C <: BlackboxContext]( c:C ) {
+case class Utils[C <: Context]( c:C ) {
import c.universe._
import c.{Tree=>_}
object removeDoubleReify extends c.universe.Transformer {
@@ -21,7 +21,7 @@ case class Utils[C <: BlackboxContext]( c:C ) {
}
}
object QueryableMacros{
- def _helper[C <: BlackboxContext,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = {
+ def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = {
import c.universe._
import treeBuild._
val element_type = implicitly[c.WeakTypeTag[S]].tpe
@@ -34,7 +34,7 @@ object QueryableMacros{
c.universe.reify{ Queryable.factory[S]( foo.splice )}
}
def map[T:c.WeakTypeTag, S:c.WeakTypeTag]
- (c: scala.reflect.macros.BlackboxContext)
+ (c: scala.reflect.macros.blackbox.Context)
(projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection )
}
class Queryable[T]{
diff --git a/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala b/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala
index bc0015774e..38ec6f022e 100644
--- a/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala
+++ b/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala
@@ -1,6 +1,6 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
val `Answer to the Ultimate Question of Life, the Universe, and Everything` = 42
- def foo(c: Ctx) = c.universe.reify { `Answer to the Ultimate Question of Life, the Universe, and Everything` }
+ def foo(c: Context) = c.universe.reify { `Answer to the Ultimate Question of Life, the Universe, and Everything` }
}
diff --git a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
index d89a5e380d..624479480d 100644
--- a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
+++ b/test/files/run/macro-reify-splice-outside-reify/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: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val x1 = c.Expr[Int](c.resetAllAttrs(x.tree))
c.Expr[Int](Literal(Constant(c.eval(x1))))
diff --git a/test/files/run/macro-reify-staticXXX/Macros_1.scala b/test/files/run/macro-reify-staticXXX/Macros_1.scala
index 077271d582..2993218bb4 100644
--- a/test/files/run/macro-reify-staticXXX/Macros_1.scala
+++ b/test/files/run/macro-reify-staticXXX/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object B { override def toString = "object" }
class C { override def toString = "class" }
@@ -14,7 +14,7 @@ object foo {
}
object packageless {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
reify {
println(B)
@@ -31,7 +31,7 @@ object packageless {
package packageful {
object Test {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
reify {
println(B)
diff --git a/test/files/run/macro-reify-tagful-a/Macros_1.scala b/test/files/run/macro-reify-tagful-a/Macros_1.scala
index 56d43c1c53..6f061fd26a 100644
--- a/test/files/run/macro-reify-tagful-a/Macros_1.scala
+++ b/test/files/run/macro-reify-tagful-a/Macros_1.scala
@@ -1,11 +1,11 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo[T](s: T) = macro Impls.foo[T]
object Impls {
- def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify {
+ def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify {
List(s.splice)
}
}
diff --git a/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala b/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala
index 27acaa1626..faac3e3a31 100644
--- a/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala
+++ b/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo[T](s: T) = macro Impls.foo[T]
object Impls {
- def foo[T](c: Ctx)(s: c.Expr[T]) = c.universe.reify {
+ def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify {
List[T](s.splice)
}
}
diff --git a/test/files/run/macro-reify-type/Macros_1.scala b/test/files/run/macro-reify-type/Macros_1.scala
index 04634b649a..bac1744c50 100644
--- a/test/files/run/macro-reify-type/Macros_1.scala
+++ b/test/files/run/macro-reify-type/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.reflect.runtime.{universe => ru}
object StaticReflect {
def method[A](name: String): ru.Type = macro methodImpl[A]
- def methodImpl[A: c.WeakTypeTag](c: BlackboxContext)(name: c.Expr[String]): c.Expr[ru.Type] = {
+ def methodImpl[A: c.WeakTypeTag](c: Context)(name: c.Expr[String]): c.Expr[ru.Type] = {
import c.universe._
val nameName: TermName = name.tree match {
diff --git a/test/files/run/macro-reify-unreify/Macros_1.scala b/test/files/run/macro-reify-unreify/Macros_1.scala
index 055959018a..6e358eb72d 100644
--- a/test/files/run/macro-reify-unreify/Macros_1.scala
+++ b/test/files/run/macro-reify-unreify/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo(s: String) = macro Impls.foo
object Impls {
- def foo(c: Ctx)(s: c.Expr[String]) = {
+ def foo(c: Context)(s: c.Expr[String]) = {
import c.universe._
import treeBuild._
diff --git a/test/files/run/macro-repl-basic.check b/test/files/run/macro-repl-basic.check
index cc974897f2..86b4d472ed 100644
--- a/test/files/run/macro-repl-basic.check
+++ b/test/files/run/macro-repl-basic.check
@@ -4,25 +4,25 @@ Type :help for more information.
scala> import language.experimental.macros
import language.experimental.macros
-scala> import scala.reflect.macros.{BlackboxContext => Ctx}
-import scala.reflect.macros.{BlackboxContext=>Ctx}
+scala> import scala.reflect.macros.blackbox.Context
+import scala.reflect.macros.blackbox.Context
scala>
scala> object Impls {
- def foo(c: Ctx)(x: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
c.Expr[Int](body)
}
- def bar(c: Ctx)(x: c.Expr[Int]) = {
+ def bar(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))
c.Expr[Int](body)
}
- def quux(c: Ctx)(x: c.Expr[Int]) = {
+ def quux(c: Context)(x: c.Expr[Int]) = {
import c.universe._
val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))
c.Expr[Int](body)
diff --git a/test/files/run/macro-repl-basic.scala b/test/files/run/macro-repl-basic.scala
index dea36c481c..217f3bc0eb 100644
--- a/test/files/run/macro-repl-basic.scala
+++ b/test/files/run/macro-repl-basic.scala
@@ -3,22 +3,22 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code = """
|import language.experimental.macros
- |import scala.reflect.macros.{BlackboxContext => Ctx}
+ |import scala.reflect.macros.blackbox.Context
|
|object Impls {
- | def foo(c: Ctx)(x: c.Expr[Int]) = {
+ | def foo(c: Context)(x: c.Expr[Int]) = {
| import c.universe._
| val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))
| c.Expr[Int](body)
| }
|
- | def bar(c: Ctx)(x: c.Expr[Int]) = {
+ | def bar(c: Context)(x: c.Expr[Int]) = {
| import c.universe._
| val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))
| c.Expr[Int](body)
| }
|
- | def quux(c: Ctx)(x: c.Expr[Int]) = {
+ | def quux(c: Context)(x: c.Expr[Int]) = {
| import c.universe._
| val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))
| c.Expr[Int](body)
diff --git a/test/files/run/macro-repl-dontexpand.check b/test/files/run/macro-repl-dontexpand.check
index 9f538c04b6..20d3b2d702 100644
--- a/test/files/run/macro-repl-dontexpand.check
+++ b/test/files/run/macro-repl-dontexpand.check
@@ -1,14 +1,14 @@
Type in expressions to have them evaluated.
Type :help for more information.
-scala> def bar1(c: scala.reflect.macros.BlackboxContext) = ???
-bar1: (c: scala.reflect.macros.BlackboxContext)Nothing
+scala> def bar1(c: scala.reflect.macros.blackbox.Context) = ???
+bar1: (c: scala.reflect.macros.blackbox.Context)Nothing
scala> def foo1 = macro bar1
defined term macro foo1: Nothing
-scala> def bar2(c: scala.reflect.macros.WhiteboxContext) = ???
-bar2: (c: scala.reflect.macros.WhiteboxContext)Nothing
+scala> def bar2(c: scala.reflect.macros.whitebox.Context) = ???
+bar2: (c: scala.reflect.macros.whitebox.Context)Nothing
scala> def foo2 = macro bar2
defined term macro foo2: Nothing
diff --git a/test/files/run/macro-repl-dontexpand.scala b/test/files/run/macro-repl-dontexpand.scala
index 733288e513..920f40084f 100644
--- a/test/files/run/macro-repl-dontexpand.scala
+++ b/test/files/run/macro-repl-dontexpand.scala
@@ -3,9 +3,9 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
override def extraSettings = "-language:experimental.macros"
def code = """
- |def bar1(c: scala.reflect.macros.BlackboxContext) = ???
+ |def bar1(c: scala.reflect.macros.blackbox.Context) = ???
|def foo1 = macro bar1
- |def bar2(c: scala.reflect.macros.WhiteboxContext) = ???
+ |def bar2(c: scala.reflect.macros.whitebox.Context) = ???
|def foo2 = macro bar2
|""".stripMargin
}
diff --git a/test/files/run/macro-settings/Impls_Macros_1.scala b/test/files/run/macro-settings/Impls_Macros_1.scala
index c9cecfa99f..851a987206 100644
--- a/test/files/run/macro-settings/Impls_Macros_1.scala
+++ b/test/files/run/macro-settings/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
reify {
println(c.Expr[String](Literal(Constant(c.settings.toString))).splice)
diff --git a/test/files/run/macro-sip19-revised/Impls_Macros_1.scala b/test/files/run/macro-sip19-revised/Impls_Macros_1.scala
index 3acc52dbe0..ded4d85cfc 100644
--- a/test/files/run/macro-sip19-revised/Impls_Macros_1.scala
+++ b/test/files/run/macro-sip19-revised/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Macros {
- def impl(c: WhiteboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val inscope = c.inferImplicitValue(c.mirror.staticClass("SourceLocation").toType)
diff --git a/test/files/run/macro-sip19/Impls_Macros_1.scala b/test/files/run/macro-sip19/Impls_Macros_1.scala
index f830d2af0d..f66ab71479 100644
--- a/test/files/run/macro-sip19/Impls_Macros_1.scala
+++ b/test/files/run/macro-sip19/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Macros {
- def impl(c: WhiteboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val Apply(fun, args) = c.enclosingImplicits(0).tree
val fileName = fun.pos.source.file.file.getName
diff --git a/test/files/run/macro-subpatterns/Macro_1.scala b/test/files/run/macro-subpatterns/Macro_1.scala
index d8e86e27c6..2de6b4da9d 100644
--- a/test/files/run/macro-subpatterns/Macro_1.scala
+++ b/test/files/run/macro-subpatterns/Macro_1.scala
@@ -1,9 +1,9 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
object Extractor {
def unapply(x: Any): Any = macro unapplyImpl
- def unapplyImpl(c: WhiteboxContext)(x: c.Tree) = {
+ def unapplyImpl(c: Context)(x: c.Tree) = {
val st = c.universe.asInstanceOf[reflect.internal.SymbolTable]
import st._
val subpatterns = x.attachments.get[SubpatternsAttachment].get.patterns
diff --git a/test/files/run/macro-system-properties.check b/test/files/run/macro-system-properties.check
index ceed1079b2..ffbd5a8aa8 100644
--- a/test/files/run/macro-system-properties.check
+++ b/test/files/run/macro-system-properties.check
@@ -1,14 +1,14 @@
Type in expressions to have them evaluated.
Type :help for more information.
-scala> import language.experimental._, reflect.macros.BlackboxContext
-import language.experimental._
-import reflect.macros.BlackboxContext
+scala> import scala.language.experimental._, scala.reflect.macros.blackbox.Context
+import scala.language.experimental._
+import scala.reflect.macros.blackbox.Context
scala> object GrabContext {
def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context])
// System.properties lets you stash true globals (unlike statics which are classloader scoped)
- def impl(c: BlackboxContext)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") }
+ def impl(c: Context)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") }
def grab(): Unit = macro impl
}
defined object GrabContext
diff --git a/test/files/run/macro-system-properties.scala b/test/files/run/macro-system-properties.scala
index 3325c1747a..db88eb7df6 100644
--- a/test/files/run/macro-system-properties.scala
+++ b/test/files/run/macro-system-properties.scala
@@ -3,11 +3,11 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code = """
- import language.experimental._, reflect.macros.BlackboxContext
+ import scala.language.experimental._, scala.reflect.macros.blackbox.Context
object GrabContext {
def lastContext = Option(System.getProperties.get("lastContext").asInstanceOf[reflect.macros.runtime.Context])
// System.properties lets you stash true globals (unlike statics which are classloader scoped)
- def impl(c: BlackboxContext)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") }
+ def impl(c: Context)() = { import c.universe._; System.getProperties.put("lastContext", c); c.Expr[Unit](q"()") }
def grab(): Unit = macro impl
}
object Test { class C(implicit a: Any) { GrabContext.grab } }
diff --git a/test/files/run/macro-term-declared-in-annotation/Impls_1.scala b/test/files/run/macro-term-declared-in-annotation/Impls_1.scala
index df3509731b..c4bcfbc1ba 100644
--- a/test/files/run/macro-term-declared-in-annotation/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-annotation/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala b/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-block/Impls_1.scala b/test/files/run/macro-term-declared-in-block/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-block/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-block/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-class-class/Impls_1.scala b/test/files/run/macro-term-declared-in-class-class/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-class-class/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-class-class/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-class-object/Impls_1.scala b/test/files/run/macro-term-declared-in-class-object/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-class-object/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-class-object/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-class/Impls_1.scala b/test/files/run/macro-term-declared-in-class/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-class/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-class/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-default-param/Impls_1.scala b/test/files/run/macro-term-declared-in-default-param/Impls_1.scala
index 4fae9b200f..ef0f136139 100644
--- a/test/files/run/macro-term-declared-in-default-param/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-default-param/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala b/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala
index 053af625a2..ef00f6ff32 100644
--- a/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala
+++ b/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def toOptionOfInt(c: Ctx) = {
+ def toOptionOfInt(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-method/Impls_1.scala b/test/files/run/macro-term-declared-in-method/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-method/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-method/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-object-class/Impls_1.scala b/test/files/run/macro-term-declared-in-object-class/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-object-class/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-object-class/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-object-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object-object/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-object-object/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-object-object/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-object/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-object/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-package-object/Impls_1.scala b/test/files/run/macro-term-declared-in-package-object/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-package-object/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-package-object/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-refinement/Impls_1.scala b/test/files/run/macro-term-declared-in-refinement/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-refinement/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-refinement/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-term-declared-in-trait/Impls_1.scala b/test/files/run/macro-term-declared-in-trait/Impls_1.scala
index d69422872b..c43f5f3f53 100644
--- a/test/files/run/macro-term-declared-in-trait/Impls_1.scala
+++ b/test/files/run/macro-term-declared-in-trait/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala
index ce937671cc..956331cfae 100644
--- a/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala
+++ b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl_with_implicits_enabled(c: BlackboxContext) = {
+ def impl_with_implicits_enabled(c: Context) = {
import c.universe._
val tree1 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2))))
@@ -11,7 +11,7 @@ object Macros {
def foo_with_implicits_enabled = macro impl_with_implicits_enabled
- def impl_with_implicits_disabled(c: BlackboxContext) = {
+ def impl_with_implicits_disabled(c: Context) = {
import c.universe._
try {
diff --git a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala
index 45b9a4fcc8..eb558f49b5 100644
--- a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala
+++ b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl_with_macros_enabled(c: BlackboxContext) = {
+ def impl_with_macros_enabled(c: Context) = {
import c.universe._
val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe"))
@@ -12,7 +12,7 @@ object Macros {
def foo_with_macros_enabled = macro impl_with_macros_enabled
- def impl_with_macros_disabled(c: BlackboxContext) = {
+ def impl_with_macros_disabled(c: Context) = {
import c.universe._
val rupkg = c.mirror.staticModule("scala.reflect.runtime.package")
diff --git a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala
index d37a654957..3412f5c88f 100644
--- a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala
+++ b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl_with_macros_enabled(c: BlackboxContext) = {
+ def impl_with_macros_enabled(c: Context) = {
import c.universe._
val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe"))
@@ -12,7 +12,7 @@ object Macros {
def foo_with_macros_enabled = macro impl_with_macros_enabled
- def impl_with_macros_disabled(c: BlackboxContext) = {
+ def impl_with_macros_disabled(c: Context) = {
import c.universe._
val rupkg = c.mirror.staticModule("scala.reflect.runtime.package")
diff --git a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala
index 1af0579abc..5df5f96aa8 100644
--- a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala
+++ b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def cons_impl[A: c.WeakTypeTag](c: BlackboxContext)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = {
+ def cons_impl[A: c.WeakTypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = {
import c.universe._
reify {
println("A = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[A]].toString))).splice)
@@ -10,7 +10,7 @@ object Macros {
}
}
- def nil_impl[B: c.WeakTypeTag](c: BlackboxContext): c.Expr[List[B]] = {
+ def nil_impl[B: c.WeakTypeTag](c: Context): c.Expr[List[B]] = {
import c.universe._
reify {
println("B = " + c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[B]].toString))).splice)
diff --git a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala
index f698320579..1eb257e1d9 100644
--- a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala
+++ b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
import scala.reflect.runtime.universe._
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl[T: c.WeakTypeTag](c: BlackboxContext)(foo: c.Expr[T]): c.Expr[Unit] = {
+ def impl[T: c.WeakTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = {
import c.universe._
reify { println(c.Expr[String](Literal(Constant(implicitly[c.WeakTypeTag[T]].toString))).splice) }
}
diff --git a/test/files/run/macro-vampire-false-warning/Macros_1.scala b/test/files/run/macro-vampire-false-warning/Macros_1.scala
index bf75e924e8..0912bfba0c 100644
--- a/test/files/run/macro-vampire-false-warning/Macros_1.scala
+++ b/test/files/run/macro-vampire-false-warning/Macros_1.scala
@@ -1,20 +1,20 @@
// As per http://meta.plasm.us/posts/2013/08/31/feeding-our-vampires/
import scala.annotation.StaticAnnotation
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
class body(tree: Any) extends StaticAnnotation
object Macros {
- def selFieldImpl(c: WhiteboxContext) = {
+ def selFieldImpl(c: Context) = {
import c.universe._
val field = c.macroApplication.symbol
val bodyAnn = field.annotations.filter(_.tpe <:< typeOf[body]).head
c.Expr[Any](bodyAnn.scalaArgs.head)
}
- def mkObjectImpl(c: WhiteboxContext)(xs: c.Expr[Any]*) = {
+ def mkObjectImpl(c: Context)(xs: c.Expr[Any]*) = {
import c.universe._
import Flag._
// val kvps = xs.toList map { case q"${_}(${Literal(Constant(name: String))}).->[${_}]($value)" => name -> value }
diff --git a/test/files/run/macro-whitebox-dynamic-materialization/Macros_1.scala b/test/files/run/macro-whitebox-dynamic-materialization/Macros_1.scala
index 87cd310b09..60a8d011f1 100644
--- a/test/files/run/macro-whitebox-dynamic-materialization/Macros_1.scala
+++ b/test/files/run/macro-whitebox-dynamic-materialization/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.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: WhiteboxContext) = {
+ def impl[T: c.WeakTypeTag](c: Context) = {
import c.universe._
val tpe = weakTypeOf[T]
if (tpe.members.exists(_.typeSignature =:= typeOf[Int]))
diff --git a/test/files/run/macro-whitebox-extractor/Macros_1.scala b/test/files/run/macro-whitebox-extractor/Macros_1.scala
index 64053b8a24..d394c0241a 100644
--- a/test/files/run/macro-whitebox-extractor/Macros_1.scala
+++ b/test/files/run/macro-whitebox-extractor/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
object Extractor {
@@ -6,7 +6,7 @@ object Extractor {
}
object Macros {
- def unapplyImpl(c: WhiteboxContext)(x: c.Tree) = {
+ def unapplyImpl(c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala b/test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala
index 671a4fff4e..a8309e35b0 100644
--- a/test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala
+++ b/test/files/run/macro-whitebox-fundep-materialization/Macros_1.scala
@@ -1,5 +1,5 @@
import scala.language.experimental.macros
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.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: WhiteboxContext): 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._
diff --git a/test/files/run/macro-whitebox-structural/Impls_Macros_1.scala b/test/files/run/macro-whitebox-structural/Impls_Macros_1.scala
index b8d0c042be..45fdb79c30 100644
--- a/test/files/run/macro-whitebox-structural/Impls_Macros_1.scala
+++ b/test/files/run/macro-whitebox-structural/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
object Macros {
- def impl(c: WhiteboxContext) = {
+ def impl(c: Context) = {
import c.universe._
q"""
trait Foo {
diff --git a/test/files/run/macroPlugins-macroArgs/Macros_2.scala b/test/files/run/macroPlugins-macroArgs/Macros_2.scala
index d6521dfbcb..b19b8f18dc 100644
--- a/test/files/run/macroPlugins-macroArgs/Macros_2.scala
+++ b/test/files/run/macroPlugins-macroArgs/Macros_2.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)(arg: c.Tree) = {
+ def impl(c: Context)(arg: c.Tree) = {
import c.universe._
q"""println($arg)"""
}
diff --git a/test/files/run/macroPlugins-macroExpand/Macros_2.scala b/test/files/run/macroPlugins-macroExpand/Macros_2.scala
index f16503b415..c9c88ad2fd 100644
--- a/test/files/run/macroPlugins-macroExpand/Macros_2.scala
+++ b/test/files/run/macroPlugins-macroExpand/Macros_2.scala
@@ -1,13 +1,13 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl1(c: BlackboxContext) = {
+ def impl1(c: Context) = {
import c.universe._
q"""println("impl1")"""
}
- def impl2(c: BlackboxContext) = {
+ def impl2(c: Context) = {
import c.universe._
q"""println("impl2")"""
}
diff --git a/test/files/run/macroPlugins-macroRuntime/Macros_2.scala b/test/files/run/macroPlugins-macroRuntime/Macros_2.scala
index d6521dfbcb..b19b8f18dc 100644
--- a/test/files/run/macroPlugins-macroRuntime/Macros_2.scala
+++ b/test/files/run/macroPlugins-macroRuntime/Macros_2.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)(arg: c.Tree) = {
+ def impl(c: Context)(arg: c.Tree) = {
import c.universe._
q"""println($arg)"""
}
diff --git a/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala b/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala
index fa8522e729..80acfec659 100644
--- a/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala
+++ b/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala
@@ -1,13 +1,13 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl1(c: BlackboxContext) = {
+ def impl1(c: Context) = {
import c.universe._
q"""println("impl1")"""
}
- def impl2(c: BlackboxContext) = {
+ def impl2(c: Context) = {
import c.universe._
q"""println("impl2")"""
}
diff --git a/test/files/run/repl-term-macros.check b/test/files/run/repl-term-macros.check
index f73abb5dc3..3580bfe1f1 100644
--- a/test/files/run/repl-term-macros.check
+++ b/test/files/run/repl-term-macros.check
@@ -1,16 +1,16 @@
Type in expressions to have them evaluated.
Type :help for more information.
-scala> import scala.reflect.macros.BlackboxContext
-import scala.reflect.macros.BlackboxContext
+scala> import scala.reflect.macros.blackbox.Context
+import scala.reflect.macros.blackbox.Context
scala> import language.experimental.macros
import language.experimental.macros
scala>
-scala> def impl1(c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
-impl1: (c: scala.reflect.macros.BlackboxContext)c.Expr[Unit]
+scala> def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
+impl1: (c: scala.reflect.macros.blackbox.Context)c.Expr[Unit]
scala> def foo1: Unit = macro impl1
defined term macro foo1: Unit
@@ -19,8 +19,8 @@ scala> foo1
scala>
-scala> def impl2(c: BlackboxContext)() = { import c.universe._; c.Expr[Unit](q"()") }
-impl2: (c: scala.reflect.macros.BlackboxContext)()c.Expr[Unit]
+scala> def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") }
+impl2: (c: scala.reflect.macros.blackbox.Context)()c.Expr[Unit]
scala> def foo2(): Unit = macro impl2
defined term macro foo2: ()Unit
@@ -29,8 +29,8 @@ scala> foo2()
scala>
-scala> def impl3(c: BlackboxContext)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") }
-impl3: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit]
+scala> def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") }
+impl3: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit]
scala> def foo3(x: Int)(y: Int): Unit = macro impl3
defined term macro foo3: (x: Int)(y: Int)Unit
diff --git a/test/files/run/repl-term-macros.scala b/test/files/run/repl-term-macros.scala
index b4660e258e..32892b7314 100644
--- a/test/files/run/repl-term-macros.scala
+++ b/test/files/run/repl-term-macros.scala
@@ -2,18 +2,18 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code = """
- import scala.reflect.macros.BlackboxContext
+ import scala.reflect.macros.blackbox.Context
import language.experimental.macros
-def impl1(c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
def foo1: Unit = macro impl1
foo1
-def impl2(c: BlackboxContext)() = { import c.universe._; c.Expr[Unit](q"()") }
+def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") }
def foo2(): Unit = macro impl2
foo2()
-def impl3(c: BlackboxContext)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") }
+def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") }
def foo3(x: Int)(y: Int): Unit = macro impl3
foo3(2)(3)
"""
diff --git a/test/files/run/t5713/Impls_Macros_1.scala b/test/files/run/t5713/Impls_Macros_1.scala
index bfe2fc4efd..7b04197cfa 100644
--- a/test/files/run/t5713/Impls_Macros_1.scala
+++ b/test/files/run/t5713/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
package m
import language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Level extends Enumeration {
val Error = Value(5)
@@ -13,7 +13,7 @@ object Logger {
private object LoggerMacros {
- type LoggerContext = BlackboxContext { type PrefixType = Logger.type }
+ type LoggerContext = Context { type PrefixType = Logger.type }
def error(c: LoggerContext)(message: c.Expr[String]): c.Expr[Unit] =
log(c)(c.universe.reify(Level.Error), message)
diff --git a/test/files/run/t5753_1/Impls_Macros_1.scala b/test/files/run/t5753_1/Impls_Macros_1.scala
index 3ddff56c38..ce07138852 100644
--- a/test/files/run/t5753_1/Impls_Macros_1.scala
+++ b/test/files/run/t5753_1/Impls_Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
trait Impls {
- def impl(c: BlackboxContext)(x: c.Expr[Any]) = x
+ def impl(c: Context)(x: c.Expr[Any]) = x
}
object Macros extends Impls {
diff --git a/test/files/run/t5753_2/Impls_Macros_1.scala b/test/files/run/t5753_2/Impls_Macros_1.scala
index c95c9a41b3..d446d37bdf 100644
--- a/test/files/run/t5753_2/Impls_Macros_1.scala
+++ b/test/files/run/t5753_2/Impls_Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{BlackboxContext => Ctx}
+import scala.reflect.macros.blackbox.Context
trait Macro_T {
- def foo[T](c: Ctx)(s: c.Expr[T]) = s
+ def foo[T](c: Context)(s: c.Expr[T]) = s
}
object Macros {
diff --git a/test/files/run/t5894.scala b/test/files/run/t5894.scala
index 5d482333f5..6e118fd396 100644
--- a/test/files/run/t5894.scala
+++ b/test/files/run/t5894.scala
@@ -1,10 +1,11 @@
-import language.experimental.macros
+import scala.reflect.macros.blackbox.Context
+import scala.language.experimental.macros
class Test
object Test {
def foo: Unit = macro fooImpl
- def fooImpl(c: reflect.macros.BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def fooImpl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
def main(args: Array[String]) {
try {
diff --git a/test/files/run/t5903a/Macros_1.scala b/test/files/run/t5903a/Macros_1.scala
index ce1b035260..5d084ceed5 100644
--- a/test/files/run/t5903a/Macros_1.scala
+++ b/test/files/run/t5903a/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
trait Tree
@@ -13,7 +13,7 @@ object NewQuasiquotes {
}
object QuasiquoteMacros {
- def unapplyImpl(c: WhiteboxContext)(t: c.Tree) = {
+ def unapplyImpl(c: Context)(t: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/run/t5903b/Macros_1.scala b/test/files/run/t5903b/Macros_1.scala
index 97f15cec3b..29a05f7fec 100644
--- a/test/files/run/t5903b/Macros_1.scala
+++ b/test/files/run/t5903b/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl[T: c.WeakTypeTag](c: WhiteboxContext)(x: c.Tree) = {
+ def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/run/t5903c/Macros_1.scala b/test/files/run/t5903c/Macros_1.scala
index 979284a263..34fe1d8808 100644
--- a/test/files/run/t5903c/Macros_1.scala
+++ b/test/files/run/t5903c/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl[T: c.WeakTypeTag](c: WhiteboxContext)(x: c.Tree) = {
+ def unapplyImpl[T: c.WeakTypeTag](c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/run/t5903d/Macros_1.scala b/test/files/run/t5903d/Macros_1.scala
index dc1989462b..f1f8dc1fde 100644
--- a/test/files/run/t5903d/Macros_1.scala
+++ b/test/files/run/t5903d/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
object Interpolation {
@@ -10,7 +10,7 @@ object Interpolation {
}
object Macros {
- def unapplyImpl(c: WhiteboxContext)(x: c.Tree) = {
+ def unapplyImpl(c: Context)(x: c.Tree) = {
import c.universe._
q"""
new {
diff --git a/test/files/run/t5923a/Macros_1.scala b/test/files/run/t5923a/Macros_1.scala
index 445392ff95..9aa7a02708 100644
--- a/test/files/run/t5923a/Macros_1.scala
+++ b/test/files/run/t5923a/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
case class C[T](t: String)
@@ -7,7 +7,7 @@ object C {
}
object Macros {
- def impl[T](c: WhiteboxContext)(ttag: c.WeakTypeTag[T]) = {
+ def impl[T](c: Context)(ttag: c.WeakTypeTag[T]) = {
import c.universe._
val ttag0 = ttag;
{
diff --git a/test/files/run/t5923d/Macros_1.scala b/test/files/run/t5923d/Macros_1.scala
index b6e7134b95..1400674d4b 100644
--- a/test/files/run/t5923d/Macros_1.scala
+++ b/test/files/run/t5923d/Macros_1.scala
@@ -1,9 +1,9 @@
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
trait MappedRow
trait RowMapper[T <: MappedRow]
object RowMapper {
implicit def mapper[T <: MappedRow]: RowMapper[T] = macro impl[T]
- def impl[T <: MappedRow : c.WeakTypeTag](c: BlackboxContext) = c.universe.reify(new RowMapper[T]{})
+ def impl[T <: MappedRow : c.WeakTypeTag](c: Context) = c.universe.reify(new RowMapper[T]{})
} \ No newline at end of file
diff --git a/test/files/run/t5940.scala b/test/files/run/t5940.scala
index 062f11c467..7b025b43af 100644
--- a/test/files/run/t5940.scala
+++ b/test/files/run/t5940.scala
@@ -4,15 +4,15 @@ object Test extends DirectTest {
def code = ???
def macros_1 = """
- import scala.reflect.macros.BlackboxContext
+ import scala.reflect.macros.blackbox.Context
object Impls {
- def impl(c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
}
object Macros {
//import Impls._
- def impl(c: BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
+ def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
def foo: Unit = macro impl
}
"""
diff --git a/test/files/run/t6187.check b/test/files/run/t6187.check
index c833b45443..97ee68271a 100644
--- a/test/files/run/t6187.check
+++ b/test/files/run/t6187.check
@@ -1,15 +1,15 @@
Type in expressions to have them evaluated.
Type :help for more information.
-scala> import language.experimental.macros, reflect.macros.BlackboxContext
-import language.experimental.macros
-import reflect.macros.BlackboxContext
+scala> import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context
+import scala.language.experimental.macros
+import scala.reflect.macros.blackbox.Context
-scala> def macroImpl[T: c.WeakTypeTag](c: BlackboxContext)(t: c.Expr[T]): c.Expr[List[T]] = {
+scala> def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = {
val r = c.universe.reify { List(t.splice) }
c.Expr[List[T]]( c.resetLocalAttrs(r.tree) )
}
-macroImpl: [T](c: scala.reflect.macros.BlackboxContext)(t: c.Expr[T])(implicit evidence$1: c.WeakTypeTag[T])c.Expr[List[T]]
+macroImpl: [T](c: scala.reflect.macros.blackbox.Context)(t: c.Expr[T])(implicit evidence$1: c.WeakTypeTag[T])c.Expr[List[T]]
scala> def demo[T](t: T): List[T] = macro macroImpl[T]
defined term macro demo: [T](t: T)List[T]
diff --git a/test/files/run/t6187.scala b/test/files/run/t6187.scala
index fc6fa6e9a7..7d84419b8a 100644
--- a/test/files/run/t6187.scala
+++ b/test/files/run/t6187.scala
@@ -2,8 +2,8 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
override def code = """
-import language.experimental.macros, reflect.macros.BlackboxContext
-def macroImpl[T: c.WeakTypeTag](c: BlackboxContext)(t: c.Expr[T]): c.Expr[List[T]] = {
+import scala.language.experimental.macros, scala.reflect.macros.blackbox.Context
+def macroImpl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = {
val r = c.universe.reify { List(t.splice) }
c.Expr[List[T]]( c.resetLocalAttrs(r.tree) )
}
diff --git a/test/files/run/t6221/Macros_1.scala b/test/files/run/t6221/Macros_1.scala
index 60ed0aa3e3..b5c28360fa 100644
--- a/test/files/run/t6221/Macros_1.scala
+++ b/test/files/run/t6221/Macros_1.scala
@@ -1,6 +1,6 @@
import language.experimental.macros
import language.implicitConversions
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import scala.reflect.runtime.universe.Tree
class ReflectiveClosure[A, B](val tree: Tree, fn: A => B) extends (A => B) {
@@ -12,7 +12,7 @@ object ReflectiveClosure {
}
object Macros {
- def reflectiveClosureImpl[A, B](c: BlackboxContext)(f: c.Expr[A => B]): c.Expr[ReflectiveClosure[A, B]] = {
+ def reflectiveClosureImpl[A, B](c: Context)(f: c.Expr[A => B]): c.Expr[ReflectiveClosure[A, B]] = {
import c.universe._
val u = treeBuild.mkRuntimeUniverseRef
val m = EmptyTree
diff --git a/test/files/run/t6381.check b/test/files/run/t6381.check
index ef08d0da09..4ed11d59ff 100644
--- a/test/files/run/t6381.check
+++ b/test/files/run/t6381.check
@@ -1,14 +1,14 @@
Type in expressions to have them evaluated.
Type :help for more information.
-scala> import language.experimental.macros
-import language.experimental.macros
+scala> import scala.language.experimental.macros
+import scala.language.experimental.macros
-scala> def pos_impl(c: reflect.macros.BlackboxContext): c.Expr[String] = {
+scala> def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = {
import c.universe._
c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString)))
}
-pos_impl: (c: scala.reflect.macros.BlackboxContext)c.Expr[String]
+pos_impl: (c: scala.reflect.macros.blackbox.Context)c.Expr[String]
scala> def pos: String = macro pos_impl
defined term macro pos: String
diff --git a/test/files/run/t6381.scala b/test/files/run/t6381.scala
index c78dc13ed7..5a687c10c1 100644
--- a/test/files/run/t6381.scala
+++ b/test/files/run/t6381.scala
@@ -2,8 +2,8 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code = """
- |import language.experimental.macros
- |def pos_impl(c: reflect.macros.BlackboxContext): c.Expr[String] = {
+ |import scala.language.experimental.macros
+ |def pos_impl(c: scala.reflect.macros.blackbox.Context): c.Expr[String] = {
| import c.universe._
| c.Expr[String](Literal(Constant(c.enclosingPosition.getClass.toString)))
|}
diff --git a/test/files/run/t6394a/Macros_1.scala b/test/files/run/t6394a/Macros_1.scala
index b934b5ebb1..376d85ba67 100644
--- a/test/files/run/t6394a/Macros_1.scala
+++ b/test/files/run/t6394a/Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c:BlackboxContext): c.Expr[Any] = {
+ def impl(c:Context): c.Expr[Any] = {
import c.universe._
val selfTree = This(c.enclosingImpl.symbol.asModule.moduleClass)
diff --git a/test/files/run/t6394b/Macros_1.scala b/test/files/run/t6394b/Macros_1.scala
index 01fbc4f09e..53215e63aa 100644
--- a/test/files/run/t6394b/Macros_1.scala
+++ b/test/files/run/t6394b/Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c:BlackboxContext): c.Expr[Any] = {
+ def impl(c:Context): c.Expr[Any] = {
import c.universe._
val selfTree = This(tpnme.EMPTY)
diff --git a/test/files/run/t6662/Macro_1.scala b/test/files/run/t6662/Macro_1.scala
index cecf242f66..419859772d 100644
--- a/test/files/run/t6662/Macro_1.scala
+++ b/test/files/run/t6662/Macro_1.scala
@@ -1,8 +1,8 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Demo {
def id[T](a: T): T = macro idImpl[T]
- def idImpl[T: c.WeakTypeTag](c: BlackboxContext)(a: c.Expr[T]): c.Expr[T] = a
+ def idImpl[T: c.WeakTypeTag](c: Context)(a: c.Expr[T]): c.Expr[T] = a
}
diff --git a/test/files/run/t6992/Macros_1.scala b/test/files/run/t6992/Macros_1.scala
index 25566dddbf..d101efdda3 100644
--- a/test/files/run/t6992/Macros_1.scala
+++ b/test/files/run/t6992/Macros_1.scala
@@ -1,5 +1,5 @@
import scala.language.experimental.macros
-import scala.reflect.macros.Context
+import scala.reflect.macros.whitebox.Context
object Macros {
def foo(name: String): Any = macro foo_impl
diff --git a/test/files/run/t7008-scala-defined/Impls_Macros_2.scala b/test/files/run/t7008-scala-defined/Impls_Macros_2.scala
index 0ce5daf0d0..7049ed6490 100644
--- a/test/files/run/t7008-scala-defined/Impls_Macros_2.scala
+++ b/test/files/run/t7008-scala-defined/Impls_Macros_2.scala
@@ -1,8 +1,8 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val decls = c.typeOf[ScalaClassWithCheckedExceptions_1[_]].declarations.toList
val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL)
diff --git a/test/files/run/t7008/Impls_Macros_2.scala b/test/files/run/t7008/Impls_Macros_2.scala
index 6da9dca913..9dfa66a20a 100644
--- a/test/files/run/t7008/Impls_Macros_2.scala
+++ b/test/files/run/t7008/Impls_Macros_2.scala
@@ -1,8 +1,8 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
val decls = c.typeOf[JavaClassWithCheckedExceptions_1[_]].declarations.toList
val s = decls.sortBy(_.name.toString).map(decl => (s"${decl.name}: ${decl.annotations}")).mkString(scala.compat.Platform.EOL)
diff --git a/test/files/run/t7047/Impls_Macros_1.scala b/test/files/run/t7047/Impls_Macros_1.scala
index 0d64729791..787ea6cfe8 100644
--- a/test/files/run/t7047/Impls_Macros_1.scala
+++ b/test/files/run/t7047/Impls_Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
class Foo
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
try {
c.inferImplicitValue(typeOf[Foo], silent = false)
diff --git a/test/files/run/t7157/Impls_Macros_1.scala b/test/files/run/t7157/Impls_Macros_1.scala
index e48fbcaed3..cc258b016a 100644
--- a/test/files/run/t7157/Impls_Macros_1.scala
+++ b/test/files/run/t7157/Impls_Macros_1.scala
@@ -1,9 +1,9 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
object AImpl {
- def a(ctx: BlackboxContext)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = {
+ def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = {
import ctx.universe._
ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1)))))
}
diff --git a/test/files/run/t7240/Macros_1.scala b/test/files/run/t7240/Macros_1.scala
index 84ad231043..019ddf7cd6 100644
--- a/test/files/run/t7240/Macros_1.scala
+++ b/test/files/run/t7240/Macros_1.scala
@@ -1,7 +1,7 @@
package bakery
import scala.language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
trait FailureCake {
implicit def liftAnyFails[T: Manifest]: Any = ???
@@ -13,7 +13,7 @@ trait FailureCake {
object Bakery {
def failure: Any = macro failureImpl
- def failureImpl(c: BlackboxContext): c.Expr[Any] = {
+ def failureImpl(c: Context): c.Expr[Any] = {
import c.universe._
def dslTrait(dslName: String) = {
diff --git a/test/files/run/t7375b/Macros_1.scala b/test/files/run/t7375b/Macros_1.scala
index bcd8e52172..b6090e730b 100644
--- a/test/files/run/t7375b/Macros_1.scala
+++ b/test/files/run/t7375b/Macros_1.scala
@@ -1,5 +1,5 @@
import language.experimental.macros
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
class C1(val n: Int) extends AnyVal
class C2(val n: Int) extends AnyRef
@@ -9,7 +9,7 @@ object Macros {
type F2 = C2
def foo = macro impl
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
def test[T: c.TypeTag] = reify(println(c.Expr[String](Literal(Constant(c.reifyRuntimeClass(c.typeOf[T]).toString))).splice)).tree
def tests = Block(List(test[C1], test[C2], test[F1], test[F2]), Literal(Constant(())))
diff --git a/test/files/run/t7617a/Macros_1.scala b/test/files/run/t7617a/Macros_1.scala
index d19f112bf4..77b18c20e2 100644
--- a/test/files/run/t7617a/Macros_1.scala
+++ b/test/files/run/t7617a/Macros_1.scala
@@ -1,12 +1,12 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
- def getValueImpl[T](c: BlackboxContext): c.Expr[T] = {
+ def getValueImpl[T](c: Context): c.Expr[T] = {
import c.universe._
c.Expr[T](Apply(Select(c.prefix.tree, newTermName("getVal")), Nil))
}
- def setValueImpl[T](c: BlackboxContext)(value: c.Expr[T]): c.Expr[Unit] = {
+ def setValueImpl[T](c: Context)(value: c.Expr[T]): c.Expr[Unit] = {
import c.universe._
c.Expr[Unit](Apply(Select(c.prefix.tree, newTermName("setVal")), List(value.tree)))
}
diff --git a/test/files/run/t7617b/Macros_1.scala b/test/files/run/t7617b/Macros_1.scala
index b1406f30bb..90fcfda47d 100644
--- a/test/files/run/t7617b/Macros_1.scala
+++ b/test/files/run/t7617b/Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
object Macros {
- def impl(c: BlackboxContext)(name: c.Expr[String])(value: c.Expr[Any]) = {
+ def impl(c: Context)(name: c.Expr[String])(value: c.Expr[Any]) = {
import c.universe._
reify(println(s"${name.splice} = ${value.splice}"))
}
diff --git a/test/files/run/t7657/Macros_1.scala b/test/files/run/t7657/Macros_1.scala
index 9aac02031d..a883f76bc3 100644
--- a/test/files/run/t7657/Macros_1.scala
+++ b/test/files/run/t7657/Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
trait T { def t(): Unit }
abstract class A extends T { override def t(): Unit = () }
-object Macro { def t(c: BlackboxContext)(): c.Expr[Unit] = c.universe.reify(()) }
+object Macro { def t(c: Context)(): c.Expr[Unit] = c.universe.reify(()) }
class C extends A { override def t(): Unit = macro Macro.t }
diff --git a/test/files/run/t7777/Macros_1.scala b/test/files/run/t7777/Macros_1.scala
index 459ab3edbb..1dc6d6740c 100644
--- a/test/files/run/t7777/Macros_1.scala
+++ b/test/files/run/t7777/Macros_1.scala
@@ -1,6 +1,6 @@
import scala.language.experimental.macros
import scala.language.dynamics
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
class DynMacro extends Dynamic {
def applyDynamic(s: String)(xs: Any*): DynMacro =
@@ -8,7 +8,7 @@ class DynMacro extends Dynamic {
}
object DynMacro extends DynMacro {
- def applyDynamicMacro(c: WhiteboxContext)(s: c.Expr[String])(xs: c.Expr[Any]*): c.Expr[DynMacro] = {
+ def applyDynamicMacro(c: Context)(s: c.Expr[String])(xs: c.Expr[Any]*): c.Expr[DynMacro] = {
import c.universe._
val Literal(Constant(n: String)) = s.tree
val args = xs.map(_.tree.toString).mkString("(", ", ", ")")
diff --git a/test/files/run/t7871/Macros_1.scala b/test/files/run/t7871/Macros_1.scala
index 801a6af4e7..dca2508128 100644
--- a/test/files/run/t7871/Macros_1.scala
+++ b/test/files/run/t7871/Macros_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.Context
+import scala.reflect.macros.whitebox.Context
import language.experimental.macros
trait Tree
diff --git a/test/files/run/t8048a/Macros_1.scala b/test/files/run/t8048a/Macros_1.scala
index f48e84f1de..d13e851d90 100644
--- a/test/files/run/t8048a/Macros_1.scala
+++ b/test/files/run/t8048a/Macros_1.scala
@@ -1,8 +1,8 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
object Macros {
- def impl(c: WhiteboxContext) = {
+ def impl(c: Context) = {
import c.universe._
q"if (true) Some(2) else None"
}
diff --git a/test/files/run/t8048b/Macros_1.scala b/test/files/run/t8048b/Macros_1.scala
index b113af86ea..520a6fac06 100644
--- a/test/files/run/t8048b/Macros_1.scala
+++ b/test/files/run/t8048b/Macros_1.scala
@@ -6,10 +6,10 @@
// * https://groups.google.com/forum/#!topic/scala-internals/eXQt-BPm4i8
import scala.language.experimental.macros
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Macros {
- def impl1(c: WhiteboxContext) = {
+ def impl1(c: Context) = {
import c.universe._
q"""
trait Foo { def x = 2 }
@@ -18,7 +18,7 @@ object Macros {
}
def foo1: Any = macro impl1
- def impl2(c: WhiteboxContext) = {
+ def impl2(c: Context) = {
import c.universe._
q"""
class Foo { def x = 2 }
@@ -27,7 +27,7 @@ object Macros {
}
def foo2: Any = macro impl2
- def impl3(c: WhiteboxContext) = {
+ def impl3(c: Context) = {
import c.universe._
q"""
new { def x = 2 }
diff --git a/test/files/run/t8104/Macros_1.scala b/test/files/run/t8104/Macros_1.scala
index 21d81a3687..2ad4bc5a99 100644
--- a/test/files/run/t8104/Macros_1.scala
+++ b/test/files/run/t8104/Macros_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.WhiteboxContext
+import scala.reflect.macros.whitebox.Context
object Macros {
- def impl[T](c: WhiteboxContext)(implicit T: c.WeakTypeTag[T]) = {
+ def impl[T](c: Context)(implicit T: c.WeakTypeTag[T]) = {
import c.universe._
import definitions._
val fields = T.tpe.declarations.toList.collect{ case x: TermSymbol if x.isVal && x.isCaseAccessor => x }
diff --git a/test/files/run/toolbox_current_run_compiles.scala b/test/files/run/toolbox_current_run_compiles.scala
index 31e0a45eea..6ec7074643 100644
--- a/test/files/run/toolbox_current_run_compiles.scala
+++ b/test/files/run/toolbox_current_run_compiles.scala
@@ -1,9 +1,9 @@
package pkg {
- import scala.reflect.macros.BlackboxContext
+ import scala.reflect.macros.blackbox.Context
import scala.language.experimental.macros
object Macros {
- def impl[T: c.WeakTypeTag](c: BlackboxContext) = {
+ def impl[T: c.WeakTypeTag](c: Context) = {
import c.universe._
val sym = c.weakTypeOf[T].typeSymbol
val g = c.universe.asInstanceOf[scala.tools.nsc.Global]
diff --git a/test/files/run/typed-annotated/Macros_1.scala b/test/files/run/typed-annotated/Macros_1.scala
index 42478cb988..d805d82f39 100644
--- a/test/files/run/typed-annotated/Macros_1.scala
+++ b/test/files/run/typed-annotated/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.BlackboxContext
+import scala.reflect.macros.blackbox.Context
import language.experimental.macros
class ann extends scala.annotation.StaticAnnotation
object Macros {
- def impl(c: BlackboxContext) = {
+ def impl(c: Context) = {
import c.universe._
// val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), nme.CONSTRUCTOR), List()), Ident(newTypeName("Int")))
val tpt = Annotated(Apply(Select(New(Ident(newTypeName("ann"))), nme.CONSTRUCTOR), List()), TypeTree(weakTypeOf[Int]))
diff --git a/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala b/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala
index 89020de7dd..be47d5cec4 100644
--- a/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala
+++ b/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[U <: String](c: Ctx) = ???
+ def foo[U <: String](c: Context) = ???
}
diff --git a/test/pending/run/macro-expand-default/Impls_1.scala b/test/pending/run/macro-expand-default/Impls_1.scala
index bb55f02ab2..fd5d8d7f18 100644
--- a/test/pending/run/macro-expand-default/Impls_1.scala
+++ b/test/pending/run/macro-expand-default/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = {
import c.universe._
val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
diff --git a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala
index 15bcb581c8..e8170fda07 100644
--- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala
+++ b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.Context
+import scala.reflect.macros.whitebox.Context
object Impls {
def foo[T: c.WeakTypeTag](c: Context): c.Expr[List[T]] = c.universe.reify {
diff --git a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala
index eed68280cd..34182b7968 100644
--- a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala
+++ b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[U](c: Ctx)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = {
+ def foo[U](c: Context)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = {
import c.universe._
val plusOne = Apply(Select(evidence.tree, TermName("plus")), List(x.tree, Literal(Constant(1))))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(plusOne))
diff --git a/test/pending/run/macro-expand-named/Impls_1.scala b/test/pending/run/macro-expand-named/Impls_1.scala
index bb55f02ab2..fd5d8d7f18 100644
--- a/test/pending/run/macro-expand-named/Impls_1.scala
+++ b/test/pending/run/macro-expand-named/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = {
+ def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = {
import c.universe._
val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
diff --git a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala
index 487ac79673..683622b29d 100644
--- a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala
+++ b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = {
+ def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = {
import c.universe._
Block(List(
Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))),
diff --git a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala
index 487ac79673..683622b29d 100644
--- a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala
+++ b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = {
+ def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = {
import c.universe._
Block(List(
Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))),
diff --git a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala
index daedde4021..741a921b72 100644
--- a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala
+++ b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala
@@ -1,5 +1,5 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
trait Impls {
- def impl(c: Ctx)(x: c.Expr[Any]) = x
+ def impl(c: Context)(x: c.Expr[Any]) = x
} \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala
index 27140a77ad..2735321eae 100644
--- a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala
+++ b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros extends Impls {
def foo(x: Any) = macro impl
diff --git a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala
index 246fc9f904..b023d31f05 100644
--- a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala
+++ b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
trait ImplContainer {
object Impls {
- def foo(c: Ctx)(x: c.Expr[Any]) = x
+ def foo(c: Context)(x: c.Expr[Any]) = x
}
} \ No newline at end of file
diff --git a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala
index da9445ac52..639d93fb5f 100644
--- a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala
+++ b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala
@@ -1,4 +1,4 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros extends ImplContainer {
def foo(x: Any) = macro Impls.foo
diff --git a/test/pending/run/macro-reify-array/Macros_1.scala b/test/pending/run/macro-reify-array/Macros_1.scala
index f970be5caa..eea0133feb 100644
--- a/test/pending/run/macro-reify-array/Macros_1.scala
+++ b/test/pending/run/macro-reify-array/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo[T](s: String) = macro Impls.foo[T]
object Impls {
- def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify {
+ def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify {
Array(s.splice)
}
}
diff --git a/test/pending/run/macro-reify-tagful-b/Macros_1.scala b/test/pending/run/macro-reify-tagful-b/Macros_1.scala
index 59dbe7157b..f4d8062a14 100644
--- a/test/pending/run/macro-reify-tagful-b/Macros_1.scala
+++ b/test/pending/run/macro-reify-tagful-b/Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo[T](s: T) = macro Impls.foo[List[T]]
object Impls {
- def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify {
+ def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify {
List(s.splice)
}
}
diff --git a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala
index a581c47026..1307052394 100644
--- a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala
+++ b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala
@@ -1,10 +1,10 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Macros {
def foo[T](s: T) = macro Impls.foo[List[T]]
object Impls {
- def foo[T](c: Ctx)(s: c.Expr[T]) = c.universe.reify {
+ def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify {
List(s.splice)
}
}
diff --git a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala
index 348f3420f2..c43f5f3f53 100644
--- a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala
+++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala
@@ -1,7 +1,7 @@
-import scala.reflect.macros.{Context => Ctx}
+import scala.reflect.macros.blackbox.Context
object Impls {
- def foo(c: Ctx) = {
+ def foo(c: Context) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix))))
diff --git a/test/scaladoc/run/SI-6812.scala b/test/scaladoc/run/SI-6812.scala
index 6893e816d0..90005b8db4 100644
--- a/test/scaladoc/run/SI-6812.scala
+++ b/test/scaladoc/run/SI-6812.scala
@@ -5,11 +5,11 @@ import language._
object Test extends ScaladocModelTest {
override def code = """
- import scala.reflect.macros.BlackboxContext
+ import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
- def impl(c: BlackboxContext) = c.literalUnit
+ def impl(c: Context) = c.literalUnit
def foo: Unit = macro impl
}
diff --git a/test/scaladoc/run/SI-6812b.scala b/test/scaladoc/run/SI-6812b.scala
index b8a8140357..74dbd130a3 100644
--- a/test/scaladoc/run/SI-6812b.scala
+++ b/test/scaladoc/run/SI-6812b.scala
@@ -5,11 +5,11 @@ import language._
object Test extends ScaladocModelTest {
override def code = """
- import scala.reflect.macros.BlackboxContext
+ import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
- def impl(c: BlackboxContext) = c.literalUnit
+ def impl(c: Context) = c.literalUnit
def foo: Unit = macro impl
}