We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e6d2c3 commit c37b408Copy full SHA for c37b408
src/dotty/tools/dotc/util/Attachment.scala
@@ -19,7 +19,15 @@ object Attachment {
19
val nx = next
20
if (nx == null) None
21
else if (nx.key eq key) Some(nx.value.asInstanceOf[V])
22
- else nx.getAttachment[V](key)
+ else nx.getAttachment(key)
23
+ }
24
+
25
+ /** Does tree have an attachment corresponding to `key`? */
26
+ final def hasAttachment[V](key: Key[V]): Boolean = {
27
+ val nx = next
28
+ if (nx == null) false
29
+ else if (nx.key eq key) true
30
+ else nx.hasAttachment(key)
31
}
32
33
/** The attachment corresponding to `key`.
0 commit comments