File tree Expand file tree Collapse file tree 4 files changed +5
-89
lines changed
test/dotty/tools/dotc/ast Expand file tree Collapse file tree 4 files changed +5
-89
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ object Trees {
3131 @ sharable var ntrees = 0
3232
3333 /** Property key for trees with documentation strings attached */
34- val DocComment = new Property .StickyKey [Comment ]
34+ val DocComment = new Property .Key [Comment ]
3535
3636 @ sharable private [this ] var nextId = 0 // for debugging
3737
@@ -910,10 +910,10 @@ object Trees {
910910 def postProcess (tree : Tree , copied : untpd.MemberDef ): copied.ThisTree [T ]
911911
912912 def finalize (tree : Tree , copied : untpd.Tree ): copied.ThisTree [T ] =
913- postProcess(tree, copied. withPos( tree.pos).withAttachmentsFrom(tree) )
913+ postProcess(tree, copied withPos tree.pos)
914914
915915 def finalize (tree : Tree , copied : untpd.MemberDef ): copied.ThisTree [T ] =
916- postProcess(tree, copied. withPos( tree.pos).withAttachmentsFrom(tree) )
916+ postProcess(tree, copied withPos tree.pos)
917917
918918 def Ident (tree : Tree )(name : Name ): Ident = tree match {
919919 case tree : BackquotedIdent =>
Original file line number Diff line number Diff line change @@ -2,12 +2,9 @@ package dotty.tools.dotc.util
22
33/** A class inheriting from Attachment.Container supports
44 * adding, removing and lookup of attachments. Attachments are typed key/value pairs.
5- *
6- * Attachments whose key is an instance of `StickyKey` will be kept when the attachments
7- * are copied using `withAttachmentsFrom`.
85 */
96object Attachment {
10- import Property .{ Key , StickyKey }
7+ import Property .Key
118
129 /** An implementation trait for attachments.
1310 * Clients should inherit from Container instead.
@@ -91,16 +88,6 @@ object Attachment {
9188 trait Container extends LinkSource {
9289 private [Attachment ] var next : Link [_] = null
9390
94- /** Copy the sticky attachments from `container` to this container. */
95- final def withAttachmentsFrom (container : Container ): this .type = {
96- var current : Link [_] = container.next
97- while (current != null ) {
98- if (current.key.isInstanceOf [StickyKey [_]]) pushAttachment(current.key, current.value)
99- current = current.next
100- }
101- this
102- }
103-
10491 final def pushAttachment [V ](key : Key [V ], value : V ): Unit = {
10592 assert(! getAttachment(key).isDefined, s " duplicate attachment for key $key" )
10693 next = new Link (key, value, next)
Original file line number Diff line number Diff line change @@ -7,12 +7,4 @@ object Property {
77
88 /** The class of keys for properties of type V */
99 class Key [+ V ]
10-
11- /**
12- * The class of keys for sticky properties of type V
13- *
14- * Sticky properties are properties that should be copied over when their container
15- * is copied.
16- */
17- class StickyKey [+ V ] extends Key [V ]
18- }
10+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments