Skip to content

Commit 4426342

Browse files
committed
Less eager tvar interpolation: wait until methods are fully applied
1 parent 8532c98 commit 4426342

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,13 @@ trait Inferencing { this: Checking =>
255255
val constraint = ctx.typerState.constraint
256256
val qualifies = (tvar: TypeVar) =>
257257
(tree contains tvar.owningTree) || ownedBy.exists && tvar.owner == ownedBy
258-
def interpolate() = Stats.track("interpolateUndetVars") {
258+
def interpolate(): Unit = Stats.track("interpolateUndetVars") {
259259
val tp = tree.tpe.widen
260+
tp match {
261+
case _: MethodType if !tree.isDef =>
262+
return
263+
case _ =>
264+
}
260265
constr.println(s"interpolate undet vars in ${tp.show}, pos = ${tree.pos}, mode = ${ctx.mode}, undets = ${constraint.uninstVars map (tvar => s"${tvar.show}@${tvar.owningTree.pos}")}")
261266
constr.println(s"qualifying undet vars: ${constraint.uninstVars filter qualifies map (tvar => s"$tvar / ${tvar.show}")}, constraint: ${constraint.show}")
262267

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
559559
val pos = params indexWhere (_.name == param.name)
560560
if (pos < mtpe.paramTypes.length) {
561561
val ptype = mtpe.paramTypes(pos)
562-
if (isFullyDefined(ptype, ForceDegree.none)) return ptype
562+
if (isFullyDefined(ptype, ForceDegree.noBottom)) return ptype
563563
}
564564
case _ =>
565565
}

0 commit comments

Comments
 (0)