summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-12-14 14:49:01 -0800
committerEugene Burmako <xeno.by@gmail.com>2012-12-14 14:49:01 -0800
commit14aa26ca0c346adbc79ccf4c0c9c35bbdd80c201 (patch)
tree2c4c54164237a80459b6aaaa01380dad70b9cdfc /src
parenta29293c8bc22b8a68b1033a440db14af49501f56 (diff)
parent098e8a084adbebca1f2e57e1aacbf6d9a3a87e7d (diff)
downloadscala-14aa26ca0c346adbc79ccf4c0c9c35bbdd80c201.tar.gz
scala-14aa26ca0c346adbc79ccf4c0c9c35bbdd80c201.tar.bz2
scala-14aa26ca0c346adbc79ccf4c0c9c35bbdd80c201.zip
Merge pull request #1766 from scalamacros/topic/typed-ident-attachments
typedIdent no longer destroys attachments
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--src/reflect/scala/reflect/internal/StdAttachments.scala1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 454b03c9b3..e4744de1b8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -5155,7 +5155,7 @@ trait Typers extends Modes with Adaptations with Tags {
val tree1 = (
if (qual == EmptyTree) tree
// atPos necessary because qualifier might come from startContext
- else atPos(tree.pos)(Select(qual, name))
+ else atPos(tree.pos)(Select(qual, name) setAttachments tree.attachments)
)
val (tree2, pre2) = makeAccessible(tree1, defSym, pre, qual)
// assert(pre.typeArgs isEmpty) // no need to add #2416-style check here, right?
diff --git a/src/reflect/scala/reflect/internal/StdAttachments.scala b/src/reflect/scala/reflect/internal/StdAttachments.scala
index 1df91a67b0..b782353ed3 100644
--- a/src/reflect/scala/reflect/internal/StdAttachments.scala
+++ b/src/reflect/scala/reflect/internal/StdAttachments.scala
@@ -10,6 +10,7 @@ trait StdAttachments {
trait Attachable {
protected var rawatt: scala.reflect.macros.Attachments { type Pos = Position } = NoPosition
def attachments = rawatt
+ def setAttachments(attachments: scala.reflect.macros.Attachments { type Pos = Position }): this.type = { rawatt = attachments; this }
def updateAttachment[T: ClassTag](attachment: T): this.type = { rawatt = rawatt.update(attachment); this }
def removeAttachment[T: ClassTag]: this.type = { rawatt = rawatt.remove[T]; this }