Skip to content

Commit bb1515e

Browse files
Flag ChildrenQueried in hasAnonymousChild
1 parent 88cfb7e commit bb1515e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/transform/SymUtils.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ class SymUtils(val self: Symbol) extends AnyVal {
145145
}.reverse
146146
}
147147

148-
def hasAnonymousChild(implicit ctx: Context): Boolean =
148+
def hasAnonymousChild(implicit ctx: Context): Boolean = {
149+
if (self.isType)
150+
self.setFlag(ChildrenQueried)
149151
children.exists(_ `eq` self)
152+
}
150153

151154
/** Is symbol directly or indirectly owned by a term symbol? */
152155
@tailrec final def isLocal(implicit ctx: Context): Boolean = {

0 commit comments

Comments
 (0)