diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-10-02 17:21:27 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-12 18:40:01 -0800 |
commit | a2b523a39b4e56eb9ab5d9a5639f5b59d425e354 (patch) | |
tree | 8d91dd18059b1166d9e7d3ee6a1ab22166d0ae7b /test/files/run/t5923c | |
parent | ce37ae45e22463a3f1a2d659d6699f2977b26c6b (diff) | |
download | scala-a2b523a39b4e56eb9ab5d9a5639f5b59d425e354.tar.gz scala-a2b523a39b4e56eb9ab5d9a5639f5b59d425e354.tar.bz2 scala-a2b523a39b4e56eb9ab5d9a5639f5b59d425e354.zip |
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.
Diffstat (limited to 'test/files/run/t5923c')
-rw-r--r-- | test/files/run/t5923c/Macros_1.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/run/t5923c/Macros_1.scala b/test/files/run/t5923c/Macros_1.scala index c980f243d4..c86e14966b 100644 --- a/test/files/run/t5923c/Macros_1.scala +++ b/test/files/run/t5923c/Macros_1.scala @@ -1,5 +1,5 @@ import language.experimental.macros -import scala.reflect.macros.BlackboxContext +import scala.reflect.macros.WhiteboxContext 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: WhiteboxContext): c.Expr[Iso[T, U]] = { import c.universe._ import definitions._ import Flag._ |