File tree 3 files changed +13
-4
lines changed
scaladoc-testcases/src/tests 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 {
131
131
class BB
132
132
}
133
133
134
+ class BModule {
135
+ def foo = " foo"
136
+ }
137
+
134
138
/** Companion object to test linking.
135
139
*
136
140
* This is my member: [[B$.Z ]]
@@ -141,7 +145,7 @@ class B extends A {
141
145
*
142
146
* And this is my term member, addressed differently: [[this.Z$ ]]
143
147
*/
144
- object B {
148
+ object B extends BModule {
145
149
type Z = Int
146
150
val Z : Int = 0
147
151
}
Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ trait MemberLookup {
88
88
import dotty .tools .dotc
89
89
given dotc .core.Contexts .Context = quotes.asInstanceOf [scala.quoted.runtime.impl.QuotesImpl ].ctx
90
90
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
+ )
92
95
// println(s"members of ${sym.show} : ${members.map(_.show).mkString(", ")}")
93
96
members.asInstanceOf [Iterator [Symbol ]]
94
97
}
@@ -144,8 +147,6 @@ trait MemberLookup {
144
147
})
145
148
else
146
149
owner.tree match {
147
- case tree : ClassDef =>
148
- findMatch(tree.body.iterator.collect { case t : Definition if hackIsNotAbsent(t.symbol) => t.symbol })
149
150
case tree : TypeDef =>
150
151
val tpe =
151
152
tree.rhs match {
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ class LookupTestCases[Q <: Quotes](val q: Quotes) {
28
28
" ???" -> cls(" scala.Predef$" ).fun(" ???" ),
29
29
" scala.List" -> cls(" scala.package$" ).tpe(" List" ),
30
30
31
+ " scala.List.lift" -> cls(" scala.PartialFunction" ).fun(" lift" ),
32
+
31
33
" tests.A" -> cls(" tests.A" ),
32
34
" tests.A$" -> cls(" tests.A$" ),
33
35
" tests.Methods.simple" -> cls(" tests.Methods" ).fun(" simple" ),
@@ -91,6 +93,8 @@ class LookupTestCases[Q <: Quotes](val q: Quotes) {
91
93
92
94
cls(" tests.inner.B" ) -> " A" -> cls(" tests.inner.A$" ),
93
95
96
+ cls(" tests.B$" ) -> " foo" -> cls(" tests.BModule" ).fun(" foo" ),
97
+
94
98
cls(" tests.D" ) -> " foo" -> cls(" tests.package$" ).fld(" foo" ),
95
99
cls(" tests.D" ) -> " bar" -> cls(" tests.tests$package$" ).fld(" bar" ),
96
100
cls(" tests.inner.A$" ) -> " foo" -> cls(" tests.package$" ).fld(" foo" ),
You can’t perform that action at this time.
0 commit comments