File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
scaladoc-testcases/src/tests Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ class B extends A {
131131 class BB
132132}
133133
134+ class BModule {
135+ def foo = " foo"
136+ }
137+
134138/** Companion object to test linking.
135139 *
136140 * This is my member: [[B$.Z ]]
@@ -141,7 +145,7 @@ class B extends A {
141145 *
142146 * And this is my term member, addressed differently: [[this.Z$ ]]
143147 */
144- object B {
148+ object B extends BModule {
145149 type Z = Int
146150 val Z : Int = 0
147151}
Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ trait MemberLookup {
8888 import dotty .tools .dotc
8989 given dotc .core.Contexts .Context = quotes.asInstanceOf [scala.quoted.runtime.impl.QuotesImpl ].ctx
9090 val sym = rsym.asInstanceOf [dotc.core.Symbols .Symbol ]
91- val members = sym.info.decls.iterator.filter(s => hackIsNotAbsent(s.asInstanceOf [Symbol ]))
91+ val members =
92+ sym.info.allMembers.iterator.map(_.symbol).filter(
93+ s => hackIsNotAbsent(s.asInstanceOf [Symbol ])
94+ )
9295 // println(s"members of ${sym.show} : ${members.map(_.show).mkString(", ")}")
9396 members.asInstanceOf [Iterator [Symbol ]]
9497 }
@@ -144,8 +147,6 @@ trait MemberLookup {
144147 })
145148 else
146149 owner.tree match {
147- case tree : ClassDef =>
148- findMatch(tree.body.iterator.collect { case t : Definition if hackIsNotAbsent(t.symbol) => t.symbol })
149150 case tree : TypeDef =>
150151 val tpe =
151152 tree.rhs match {
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ class LookupTestCases[Q <: Quotes](val q: Quotes) {
2828 " ???" -> cls(" scala.Predef$" ).fun(" ???" ),
2929 " scala.List" -> cls(" scala.package$" ).tpe(" List" ),
3030
31+ " scala.List.lift" -> cls(" scala.PartialFunction" ).fun(" lift" ),
32+
3133 " tests.A" -> cls(" tests.A" ),
3234 " tests.A$" -> cls(" tests.A$" ),
3335 " tests.Methods.simple" -> cls(" tests.Methods" ).fun(" simple" ),
@@ -91,6 +93,8 @@ class LookupTestCases[Q <: Quotes](val q: Quotes) {
9193
9294 cls(" tests.inner.B" ) -> " A" -> cls(" tests.inner.A$" ),
9395
96+ cls(" tests.B$" ) -> " foo" -> cls(" tests.BModule" ).fun(" foo" ),
97+
9498 cls(" tests.D" ) -> " foo" -> cls(" tests.package$" ).fld(" foo" ),
9599 cls(" tests.D" ) -> " bar" -> cls(" tests.tests$package$" ).fld(" bar" ),
96100 cls(" tests.inner.A$" ) -> " foo" -> cls(" tests.package$" ).fld(" foo" ),
You can’t perform that action at this time.
0 commit comments