From 4be6ea147a7d8f300c1e6db2a216b50fe8cf5dc7 Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Mon, 2 Dec 2013 13:26:01 +0100 Subject: Provide a way for unapply macro to obtain a list of subpattens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces internal attachment that allows unapply macros to be aware of their sub patterns and tweak their expansion depending on that info. At the moment this is not possible due to the way pattern macros are expanded: case MacroPat(inner1, inner2) => ... During type checking this will expand as MacroPat.unapply() Meaning that macro can’t see inner1 and inner2 in it’s macroApplication. To circumvent this we attach that info as an attachment to the dummy. --- src/reflect/scala/reflect/runtime/JavaUniverseForce.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/reflect/scala/reflect/runtime/JavaUniverseForce.scala') diff --git a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala index 974706aa0b..e296a28779 100644 --- a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala +++ b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala @@ -57,6 +57,7 @@ trait JavaUniverseForce { self: runtime.JavaUniverse => this.CompoundTypeTreeOriginalAttachment this.BackquotedIdentifierAttachment this.ForAttachment + this.SubpatternsAttachment this.noPrint this.typeDebug // inaccessible: this.maxFree -- cgit v1.2.3