File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,19 @@ object Trees {
60
60
with Cloneable {
61
61
62
62
if (Stats .enabled) ntrees += 1
63
+
64
+ private def nxId = {
65
+ nextId += 1
66
+ // assert(nextId != 199, this)
67
+ nextId
68
+ }
63
69
64
70
/** A unique identifier for this tree. Used for debugging, and potentially
65
71
* tracking presentation compiler interactions
66
72
*/
67
- val uniqueId = {
68
- nextId += 1
69
- // assert(nextId != 214, this)
70
- nextId
71
- }
73
+ private var myUniqueId : Int = nxId
74
+
75
+ def uniqueId = myUniqueId
72
76
73
77
/** The type constructor at the root of the tree */
74
78
type ThisTree [T >: Untyped ] <: Tree [T ]
@@ -188,6 +192,12 @@ object Trees {
188
192
189
193
override def hashCode (): Int = uniqueId // for debugging; was: System.identityHashCode(this)
190
194
override def equals (that : Any ) = this eq that.asInstanceOf [AnyRef ]
195
+
196
+ override def clone : Tree [T ] = {
197
+ val tree = super .clone.asInstanceOf [Tree [T ]]
198
+ tree.myUniqueId = nxId
199
+ tree
200
+ }
191
201
}
192
202
193
203
class UnAssignedTypeException [T >: Untyped ](tree : Tree [T ]) extends RuntimeException {
You can’t perform that action at this time.
0 commit comments