Skip to content

Commit 9299ece

Browse files
committed
Simplify logic in mapOwner
1 parent b6d19de commit 9299ece

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,9 @@ object Erasure {
698698
def mapOwner(sym: Symbol): Symbol =
699699
if !sym.exists && tree.name == nme.apply then
700700
// PolyFunction apply Selects will not have a symbol, so deduce the owner
701-
// from the typed qual.
702-
val owner = qual1.tpe.typeSymbol
703-
if defn.isFunctionClass(owner) && false then owner
704-
else
705-
val alt = erasure(tree.qualifier.typeOpt).typeSymbol
706-
if defn.isFunctionClass(alt) then alt
707-
else NoSymbol
701+
// from the typed the erasure of the original qualifier.
702+
val owner = erasure(tree.qualifier.typeOpt).typeSymbol
703+
if defn.isFunctionClass(owner) then owner else NoSymbol
708704
else
709705
val owner = sym.maybeOwner
710706
if defn.specialErasure.contains(owner) then

0 commit comments

Comments
 (0)