@@ -1698,9 +1698,10 @@ object Types {
1698
1698
finally ctx.typerState.ephemeral |= savedEphemeral
1699
1699
}
1700
1700
1701
- private def disambiguate (d : Denotation )(implicit ctx : Context ): Denotation = {
1702
- val sig = currentSignature
1703
- // if (ctx.isAfterTyper) println(i"overloaded $this / $d / sig = $sig") // DEBUG
1701
+ private def disambiguate (d : Denotation )(implicit ctx : Context ): Denotation =
1702
+ disambiguate(d, currentSignature)
1703
+
1704
+ private def disambiguate (d : Denotation , sig : Signature )(implicit ctx : Context ): Denotation =
1704
1705
if (sig != null )
1705
1706
d.atSignature(sig, relaxed = ! ctx.erasedTypes) match {
1706
1707
case d1 : SingleDenotation => d1
@@ -1711,7 +1712,6 @@ object Types {
1711
1712
}
1712
1713
}
1713
1714
else d
1714
- }
1715
1715
1716
1716
private def memberDenot (name : Name , allowPrivate : Boolean )(implicit ctx : Context ): Denotation = {
1717
1717
var d = memberDenot(prefix, name, allowPrivate)
@@ -1974,12 +1974,10 @@ object Types {
1974
1974
def reload (): NamedType = {
1975
1975
val allowPrivate = ! lastSymbol.exists || lastSymbol.is(Private ) && prefix.classSymbol == this .prefix.classSymbol
1976
1976
var d = memberDenot(prefix, name, allowPrivate)
1977
- if (d.isOverloaded && lastSymbol.exists) {
1978
- val targetSig =
1979
- if (lastSymbol.signature == Signature .NotAMethod ) Signature .NotAMethod
1980
- else lastSymbol.asSeenFrom(prefix).signature
1981
- d = d.atSignature(targetSig, relaxed = ! ctx.erasedTypes)
1982
- }
1977
+ if (d.isOverloaded && lastSymbol.exists)
1978
+ d = disambiguate(d,
1979
+ if (lastSymbol.signature == Signature .NotAMethod ) Signature .NotAMethod
1980
+ else lastSymbol.asSeenFrom(prefix).signature)
1983
1981
NamedType (prefix, name, d)
1984
1982
}
1985
1983
if (prefix eq this .prefix) this
0 commit comments