From a2b523a39b4e56eb9ab5d9a5639f5b59d425e354 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Wed, 2 Oct 2013 17:21:27 +0200 Subject: blackbox restriction #1: can't refine the official return type When an application of a blackbox macro expands into a tree `x`, the expansion is wrapped into a type ascription `(x: T)`, where `T` is the declared return type of the blackbox macro with type arguments and path dependencies applied in consistency with the particular macro application being expanded. This invalidates blackbox macros as an implementation vehicle of type providers. --- test/files/run/t5903c/Macros_1.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/files/run/t5903c') diff --git a/test/files/run/t5903c/Macros_1.scala b/test/files/run/t5903c/Macros_1.scala index da7dd5281c..c9dfe9d60c 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.BlackboxContext +import scala.reflect.macros.WhiteboxContext 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: WhiteboxContext)(x: c.Tree) = { import c.universe._ q""" new { -- cgit v1.2.3