File tree 4 files changed +5
-89
lines changed
test/dotty/tools/dotc/ast
4 files changed +5
-89
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ object Trees {
31
31
@ sharable var ntrees = 0
32
32
33
33
/** Property key for trees with documentation strings attached */
34
- val DocComment = new Property .StickyKey [Comment ]
34
+ val DocComment = new Property .Key [Comment ]
35
35
36
36
@ sharable private [this ] var nextId = 0 // for debugging
37
37
@@ -910,10 +910,10 @@ object Trees {
910
910
def postProcess (tree : Tree , copied : untpd.MemberDef ): copied.ThisTree [T ]
911
911
912
912
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)
914
914
915
915
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)
917
917
918
918
def Ident (tree : Tree )(name : Name ): Ident = tree match {
919
919
case tree : BackquotedIdent =>
Original file line number Diff line number Diff line change @@ -2,12 +2,9 @@ package dotty.tools.dotc.util
2
2
3
3
/** A class inheriting from Attachment.Container supports
4
4
* 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`.
8
5
*/
9
6
object Attachment {
10
- import Property .{ Key , StickyKey }
7
+ import Property .Key
11
8
12
9
/** An implementation trait for attachments.
13
10
* Clients should inherit from Container instead.
@@ -91,16 +88,6 @@ object Attachment {
91
88
trait Container extends LinkSource {
92
89
private [Attachment ] var next : Link [_] = null
93
90
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
-
104
91
final def pushAttachment [V ](key : Key [V ], value : V ): Unit = {
105
92
assert(! getAttachment(key).isDefined, s " duplicate attachment for key $key" )
106
93
next = new Link (key, value, next)
Original file line number Diff line number Diff line change @@ -7,12 +7,4 @@ object Property {
7
7
8
8
/** The class of keys for properties of type V */
9
9
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