File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ trait TypeAssigner {
168
168
val d2 = pre.nonPrivateMember(name)
169
169
if (reallyExists(d2) && firstTry)
170
170
test(tpe.shadowed.withDenot(d2), false )
171
- else {
171
+ else if (pre.derivesFrom(defn.DynamicClass )) {
172
+ TryDynamicCallType
173
+ } else {
172
174
val alts = tpe.denot.alternatives.map(_.symbol).filter(_.exists)
173
175
val what = alts match {
174
176
case Nil =>
@@ -203,9 +205,8 @@ trait TypeAssigner {
203
205
*/
204
206
def selectionType (site : Type , name : Name , pos : Position )(implicit ctx : Context ): Type = {
205
207
val mbr = site.member(name)
206
- lazy val canBeDynamicMethod = site.derivesFrom(defn.DynamicClass ) && ! Dynamic .isDynamicMethod(name)
207
- if (reallyExists(mbr) && (mbr.accessibleFrom(site).exists || ! canBeDynamicMethod)) site.select(name, mbr)
208
- else if (canBeDynamicMethod) {
208
+ if (reallyExists(mbr)) site.select(name, mbr)
209
+ else if (site.derivesFrom(defn.DynamicClass ) && ! Dynamic .isDynamicMethod(name)) {
209
210
TryDynamicCallType
210
211
} else {
211
212
if (! site.isErroneous) {
You can’t perform that action at this time.
0 commit comments