@@ -1698,9 +1698,10 @@ object Types {
16981698 finally ctx.typerState.ephemeral |= savedEphemeral
16991699 }
17001700
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 =
17041705 if (sig != null )
17051706 d.atSignature(sig, relaxed = ! ctx.erasedTypes) match {
17061707 case d1 : SingleDenotation => d1
@@ -1711,7 +1712,6 @@ object Types {
17111712 }
17121713 }
17131714 else d
1714- }
17151715
17161716 private def memberDenot (name : Name , allowPrivate : Boolean )(implicit ctx : Context ): Denotation = {
17171717 var d = memberDenot(prefix, name, allowPrivate)
@@ -1974,12 +1974,10 @@ object Types {
19741974 def reload (): NamedType = {
19751975 val allowPrivate = ! lastSymbol.exists || lastSymbol.is(Private ) && prefix.classSymbol == this .prefix.classSymbol
19761976 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)
19831981 NamedType (prefix, name, d)
19841982 }
19851983 if (prefix eq this .prefix) this
0 commit comments