Skip to content

Commit 7d9e02a

Browse files
committed
Look upon my works, ye brave, and behold the kludges
1 parent 60c4c8f commit 7d9e02a

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
@@ -59,11 +59,19 @@ trait MemberLookup {
5959
import dotty.tools.dotc
6060
given dotc.core.Contexts.Context = rootContext.asInstanceOf
6161
val sym = rsym.asInstanceOf[dotc.core.Symbols.Symbol]
62-
val members = sym.info.decls.iterator.filterNot(_.isAbsent(false))
62+
val members = sym.info.decls.iterator.filter(_.isCompleted)
6363
// println(s"members of ${sym.show} : ${members.map(_.show).mkString(", ")}")
6464
members.asInstanceOf[Iterator[Symbol]]
6565
}
6666

67+
private def hackIsNotAbsent(using QuoteContext)(rsym: qctx.reflect.Symbol) = {
68+
import qctx.reflect._
69+
import dotty.tools.dotc
70+
given dotc.core.Contexts.Context = rootContext.asInstanceOf
71+
val sym = rsym.asInstanceOf[dotc.core.Symbols.Symbol]
72+
sym.isCompleted
73+
}
74+
6775
private def localLookup(using QuoteContext)(query: String, owner: qctx.reflect.Symbol): Option[qctx.reflect.Symbol] = {
6876
import qctx.reflect._
6977

@@ -111,7 +119,7 @@ trait MemberLookup {
111119
else
112120
owner.tree match {
113121
case tree: ClassDef =>
114-
findMatch(tree.body.iterator.collect { case t: Definition => t.symbol })
122+
findMatch(tree.body.iterator.collect { case t: Definition if hackIsNotAbsent(t.symbol) => t.symbol })
115123
case _ =>
116124
findMatch(hackMembersOf(owner))
117125
}

0 commit comments

Comments
 (0)