File tree 1 file changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1539,7 +1539,11 @@ object Types {
1539
1539
}
1540
1540
1541
1541
final def name (implicit ctx : Context ): ThisName = {
1542
- if (myName == null ) myName = designator.asInstanceOf [Symbol ].name.asInstanceOf [ThisName ]
1542
+ if (myName == null ) {
1543
+ val sym = designator.asInstanceOf [Symbol ]
1544
+ val d = if (sym.exists || lastDenotation == null ) sym.denot else lastDenotation
1545
+ myName = d.name.asInstanceOf [ThisName ]
1546
+ }
1543
1547
myName
1544
1548
}
1545
1549
@@ -2022,7 +2026,9 @@ object Types {
2022
2026
2023
2027
def withPrefix (prefix : Type )(implicit ctx : Context ): NamedType = designator match {
2024
2028
case designator : TermSymbol @ unchecked =>
2025
- TermRef (prefix, designator)
2029
+ val core = TermRef (prefix, designator)
2030
+ if (isOverloaded && Config .newScheme) core.withDenot(denot.asSeenFrom(prefix))
2031
+ else core
2026
2032
case _ =>
2027
2033
// If symbol exists, the new signature is the symbol's signature as seen
2028
2034
// from the new prefix, modulo consistency
You can’t perform that action at this time.
0 commit comments