From 6d4f43503f718610182d9529695d7aed02333e37 Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Sat, 19 Oct 2013 20:10:09 +0200 Subject: SI-6840 fixes weird typing of quasiquote arguments Previously quasiquote arguments were type checked against Any which caused weird inference that made splicing of complex expressions unusable: val l1 = List(q"foo") val l2 = List(q"bar") q"f(..${l1 ++ l2})" // argument type checked as Any instead of List[Tree] This is fixed by forcing compiler to type check against type variable which itself isn't used in any other way. --- src/reflect/scala/reflect/api/Quasiquotes.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/reflect') diff --git a/src/reflect/scala/reflect/api/Quasiquotes.scala b/src/reflect/scala/reflect/api/Quasiquotes.scala index 8e993af382..3687ccba63 100644 --- a/src/reflect/scala/reflect/api/Quasiquotes.scala +++ b/src/reflect/scala/reflect/api/Quasiquotes.scala @@ -7,7 +7,7 @@ trait Quasiquotes { self: Universe => // using the mechanism implemented in `scala.tools.reflect.FastTrack` implicit class Quasiquote(ctx: StringContext) { protected trait api { - def apply(args: Any*): Any = macro ??? + def apply[T](args: T*): Any = macro ??? def unapply(scrutinee: Any): Any = macro ??? } object q extends api -- cgit v1.2.3