Skip to content

Commit f208994

Browse files
committed
shortcut lookup overload in superclasses
1 parent 59f208b commit f208994

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
@@ -1196,18 +1196,18 @@ class TreeUnpickler(reader: TastyReader,
11961196
|but could not find method `$name` (${sname.info}):
11971197
| - $symPart.""".stripMargin)
11981198

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

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

0 commit comments

Comments
 (0)