diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-02-01 00:19:16 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-14 23:51:24 +0100 |
commit | 462d0b8b1c9de95baad773856a7e1f658ebd0956 (patch) | |
tree | 7d8476b9f174d53c2e68d8255a5e221c30db3e6c /test/files/run | |
parent | 8c29132055845181a34ed9077d30fac87c284574 (diff) | |
download | scala-462d0b8b1c9de95baad773856a7e1f658ebd0956.tar.gz scala-462d0b8b1c9de95baad773856a7e1f658ebd0956.tar.bz2 scala-462d0b8b1c9de95baad773856a7e1f658ebd0956.zip |
adds internal.subpatterns
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.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/macro-subpatterns/Macro_1.scala | 3 |
1 files changed, 1 insertions, 2 deletions
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) """ |