Skip to content

Commit 674a589

Browse files
committed
Look upon my works, ye brave, and behold the kludges
1 parent 66e5612 commit 674a589

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scala3doc/src/dotty/dokka/tasty/comments/MemberLookup.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,19 @@ trait MemberLookup {
6464
import dotty.tools.dotc
6565
given dotc.core.Contexts.Context = rootContext.asInstanceOf
6666
val sym = rsym.asInstanceOf[dotc.core.Symbols.Symbol]
67-
val members = sym.info.decls.iterator.filterNot(_.isAbsent(false))
67+
val members = sym.info.decls.iterator.filter(_.isCompleted)
6868
// println(s"members of ${sym.show} : ${members.map(_.show).mkString(", ")}")
6969
members.asInstanceOf[Iterator[Symbol]]
7070
}
7171

72+
private def hackIsNotAbsent(using QuoteContext)(rsym: qctx.reflect.Symbol) = {
73+
import qctx.reflect._
74+
import dotty.tools.dotc
75+
given dotc.core.Contexts.Context = rootContext.asInstanceOf
76+
val sym = rsym.asInstanceOf[dotc.core.Symbols.Symbol]
77+
sym.isCompleted
78+
}
79+
7280
private def localLookup(using QuoteContext)(query: String, owner: qctx.reflect.Symbol): Option[qctx.reflect.Symbol] = {
7381
import qctx.reflect._
7482

@@ -116,7 +124,7 @@ trait MemberLookup {
116124
else
117125
owner.tree match {
118126
case tree: ClassDef =>
119-
findMatch(tree.body.iterator.collect { case t: Definition => t.symbol })
127+
findMatch(tree.body.iterator.collect { case t: Definition if hackIsNotAbsent(t.symbol) => t.symbol })
120128
case _ =>
121129
findMatch(hackMembersOf(owner))
122130
}

0 commit comments

Comments
 (0)