From bce97058c4733f4c7bfac473db6bf378942900b8 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 19 Dec 2013 00:03:24 +0100 Subject: makes boxity of fast track macros configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, all built-in macros were assumed to be whitebox, but that’s actually not the case. Just quasiquote macros have to be whitebox, while the rest can be blackbox. This also fixes SI-8091, because blackbox macros are typechecked differently and therefore the necessary implicit conversion kicks in. If `f”...”` were to remain a whitebox macro, then due to the changes introduced in commit https://github.com/scala/scala/commit/a3b33419b02cafb7e2c6fed6dd96151859fc7d77 we would have to explicitly ascribe its expansion as String to achieve the same effect. After I made reify blackbox, several tests had to be changed, because we now explicitly ascribe the expansion with `c.Expr[T]`, which changes `toString`. Also, a number of less obvious corrections had to be applied, because things like `reify().splice` have stopped being optimized away due to `reify()` no longer having a narrow `c.Expr[.type]`, making it ineligible for constant folding. Moreover, this change forced me to adjust our approach to positioning blackbox wrappings, because after being changed to blacbox and starting using wrappings, f”...” interpolators used in the compiler started crashing -Yrangepos builds. Now wrapping Typed nodes are assigned with transparent positions. --- test/files/run/toolbox_typecheck_macrosdisabled2.check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/files/run/toolbox_typecheck_macrosdisabled2.check') diff --git a/test/files/run/toolbox_typecheck_macrosdisabled2.check b/test/files/run/toolbox_typecheck_macrosdisabled2.check index 9810946024..8e554a6c8f 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled2.check +++ b/test/files/run/toolbox_typecheck_macrosdisabled2.check @@ -1,4 +1,4 @@ -{ +({ val $u: ru.type = ru; val $m: $u.Mirror = ru.runtimeMirror({ final class $anon extends scala.AnyRef { @@ -37,5 +37,5 @@ }; new $typecreator2() })) -} +}: ru.Expr[Array[Int]]) ru.reify[Array[Int]](scala.Array.apply(2)) -- cgit v1.2.3