From 462d0b8b1c9de95baad773856a7e1f658ebd0956 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 1 Feb 2014 00:19:16 +0100 Subject: adds internal.subpatterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per Denys’s request, this commit exposes the hack that we use to obtain subpatterns of UnApply nodes. This is useful when writing quasiquoting macros that do pattern matching. --- test/files/run/macro-subpatterns/Macro_1.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test') diff --git a/test/files/run/macro-subpatterns/Macro_1.scala b/test/files/run/macro-subpatterns/Macro_1.scala index 994421aa32..e009e411a2 100644 --- a/test/files/run/macro-subpatterns/Macro_1.scala +++ b/test/files/run/macro-subpatterns/Macro_1.scala @@ -6,11 +6,10 @@ object Extractor { def unapplyImpl(c: Context)(x: c.Tree) = { import c.universe._ import internal._ - val subpatterns = attachments(x).get[scala.reflect.internal.SymbolTable#SubpatternsAttachment].get.patterns.toString q""" new { def isEmpty = false - def get = $subpatterns + def get = ${subpatterns(x).toString} def unapply(x: Any) = this }.unapply($x) """ -- cgit v1.2.3