diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-20 10:51:01 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:28:31 +0100 |
commit | 5f318bc925c227d2bce5cff31610803185b57f54 (patch) | |
tree | 70ab60ecc7fd94666d3428a45e3ed4f3695a9305 | |
parent | 72a5f392bf11b6474b351cd81a17d0ceeed13dcc (diff) | |
download | dotty-5f318bc925c227d2bce5cff31610803185b57f54.tar.gz dotty-5f318bc925c227d2bce5cff31610803185b57f54.tar.bz2 dotty-5f318bc925c227d2bce5cff31610803185b57f54.zip |
Fix of t1272: overloading resolution
stripImplicits needs to take polytypes into account.
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 12 | ||||
-rw-r--r-- | tests/pos/t1272.scala (renamed from tests/pending/pos/t1272.scala) | 0 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index 4d26532d6..46a6ebf66 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -785,9 +785,13 @@ trait Applications extends Compatibility { self: Typer => }} /** Drop any implicit parameter section */ - def stripImplicit(tp: Type) = tp match { - case mt: ImplicitMethodType if !mt.isDependent => mt.resultType // todo: make sure implicit method types are not dependent - case _ => tp + def stripImplicit(tp: Type): Type = tp match { + case mt: ImplicitMethodType if !mt.isDependent => + mt.resultType // todo: make sure implicit method types are not dependent + case pt: PolyType => + pt.derivedPolyType(pt.paramNames, pt.paramBounds, stripImplicit(pt.resultType)) + case _ => + tp } val owner1 = alt1.symbol.owner @@ -800,6 +804,8 @@ trait Applications extends Compatibility { self: Typer => def winsOwner2 = isDerived(owner2, owner1) def winsType2 = isAsSpecific(alt2, tp2, alt1, tp1) + implicits.println(i"isAsGood($alt1, $alt2)? $tp1 $tp2 $winsOwner1 $winsType1 $winsOwner2 $winsType2") + // Assume the following probabilities: // // P(winsOwnerX) = 2/3 diff --git a/tests/pending/pos/t1272.scala b/tests/pos/t1272.scala index 916b783bb..916b783bb 100644 --- a/tests/pending/pos/t1272.scala +++ b/tests/pos/t1272.scala |