aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-01 22:00:41 +0100
committerMartin Odersky <odersky@gmail.com>2017-03-01 22:08:17 +0100
commit58b71ca50ded400efa92ac8d92f4378844baaf7d (patch)
treedd0814ee5d73996ef6e91e7d4e12c82af883d80b /compiler/src/dotty/tools/dotc/typer/Applications.scala
parente01ca04c28e242a5f602dffc28a1b1eae358ecaf (diff)
downloaddotty-58b71ca50ded400efa92ac8d92f4378844baaf7d.tar.gz
dotty-58b71ca50ded400efa92ac8d92f4378844baaf7d.tar.bz2
dotty-58b71ca50ded400efa92ac8d92f4378844baaf7d.zip
Fix handling of dependent method types
Need to use fresh PolyParams instead of WildcardTypes if constraint is committable.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Applications.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala
index bca44997d..e45924f83 100644
--- a/compiler/src/dotty/tools/dotc/typer/Applications.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala
@@ -213,8 +213,9 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
protected def init() = methType match {
case methType: MethodType =>
// apply the result type constraint, unless method type is dependent
+ val resultApprox = resultTypeApprox(methType)
val savedConstraint = ctx.typerState.constraint
- if (!constrainResult(methType.resultTypeApprox, resultType))
+ if (!constrainResult(resultApprox, resultType))
if (ctx.typerState.isCommittable)
// defer the problem until after the application;
// it might be healed by an implicit conversion
@@ -1099,7 +1100,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
/** Drop any implicit parameter section */
def stripImplicit(tp: Type): Type = tp match {
case mt: ImplicitMethodType =>
- mt.resultTypeApprox
+ resultTypeApprox(mt)
case pt: PolyType =>
pt.derivedPolyType(pt.paramNames, pt.paramBounds, stripImplicit(pt.resultType))
case _ =>