Skip to content

Commit 8ed117c

Browse files
committed
shortcut lookup overload in superclasses
1 parent 7713419 commit 8ed117c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,18 +1198,18 @@ class TreeUnpickler(reader: TastyReader,
11981198
|but could not find method `$name` (${sname.info}):
11991199
| - $symPart.""".stripMargin)
12001200

1201-
val denot =
1201+
def lookupSuper =
12021202
val cls = ownerTpe.classSymbol
1203-
if !cls.exists then NoDenotation
1203+
if cls.exists then
1204+
cls.asClass.classDenot
1205+
.findMember(name, cls.thisType, EmptyFlags, excluded=Private)
1206+
.atSignature(sig, target)
12041207
else
1205-
val clsDenot = cls.asClass.classDenot
1206-
val d0 = clsDenot.findMember(name, cls.thisType, EmptyFlags, EmptyFlags).atSignature(sig, target)
1207-
if !d0.symbol.exists || d0.symbol.isAccessibleFrom(prefix) then
1208-
d0.asSeenFrom(prefix)
1209-
else
1210-
clsDenot.findMember(name, cls.thisType, EmptyFlags, excluded=Private)
1211-
.atSignature(sig, target)
1212-
.asSeenFrom(prefix)
1208+
NoDenotation
1209+
1210+
val denot =
1211+
val d = ownerTpe.decl(name).atSignature(sig, target)
1212+
(if !d.exists then lookupSuper else d).asSeenFrom(prefix)
12131213

12141214
val select = makeSelect(qual, name, denot)
12151215
if !(owner.exists && denot.exists) && ctx.settings.YstrictTasty.value then

0 commit comments

Comments
 (0)