Skip to content

Commit 5f318bc

Browse files
oderskygzm0
authored andcommitted
Fix of t1272: overloading resolution
stripImplicits needs to take polytypes into account.
1 parent 72a5f39 commit 5f318bc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,13 @@ trait Applications extends Compatibility { self: Typer =>
785785
}}
786786

787787
/** Drop any implicit parameter section */
788-
def stripImplicit(tp: Type) = tp match {
789-
case mt: ImplicitMethodType if !mt.isDependent => mt.resultType // todo: make sure implicit method types are not dependent
790-
case _ => tp
788+
def stripImplicit(tp: Type): Type = tp match {
789+
case mt: ImplicitMethodType if !mt.isDependent =>
790+
mt.resultType // todo: make sure implicit method types are not dependent
791+
case pt: PolyType =>
792+
pt.derivedPolyType(pt.paramNames, pt.paramBounds, stripImplicit(pt.resultType))
793+
case _ =>
794+
tp
791795
}
792796

793797
val owner1 = alt1.symbol.owner
@@ -800,6 +804,8 @@ trait Applications extends Compatibility { self: Typer =>
800804
def winsOwner2 = isDerived(owner2, owner1)
801805
def winsType2 = isAsSpecific(alt2, tp2, alt1, tp1)
802806

807+
implicits.println(i"isAsGood($alt1, $alt2)? $tp1 $tp2 $winsOwner1 $winsType1 $winsOwner2 $winsType2")
808+
803809
// Assume the following probabilities:
804810
//
805811
// P(winsOwnerX) = 2/3
File renamed without changes.

0 commit comments

Comments
 (0)