@@ -4265,32 +4265,25 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4265
4265
)
4266
4266
case _ =>
4267
4267
mapOver(t)
4268
- val ownedVars = ctx.typerState.ownedVars
4269
- def qualifying = (ownedVars -- locked).toList
4270
4268
val resultAlreadyConstrained = pt1.isInstanceOf [MethodOrPoly ]
4271
4269
if ! formal.isGround
4272
4270
&& (formal.simplified `ne` formal)
4273
4271
&& (pt1 `ne` pt)
4274
4272
&& (pt1 ne sharpenedPt)
4275
- && (ownedVars ne locked)
4276
- && ! ownedVars.isEmpty
4277
- && qualifying.nonEmpty
4278
4273
&& ! resultAlreadyConstrained then
4279
4274
val approxRes = wildApprox(pt1.resultType)
4280
4275
val stripedApproxRes = tm(approxRes)
4281
4276
if ! stripedApproxRes.containsWildcardTypes then
4282
- if ctx.typerState.isCommittable then
4283
- return NoViewsAllowed .constrainResult(tree.symbol, wtp.resultType, stripedApproxRes)
4284
- else return constrainResult(tree.symbol, wtp.resultType, stripedApproxRes)
4277
+ return wtp.resultType <:< stripedApproxRes
4285
4278
false
4286
4279
}
4287
4280
4288
4281
val pt1 = pt.deepenProtoTrans
4289
- val isConstrained = tryConstrainType(pt1)
4282
+ tryConstrainType(pt1)
4290
4283
val arg = inferImplicitArg(formal, tree.span.endPos)
4291
4284
arg.tpe match
4292
4285
case failed : AmbiguousImplicits =>
4293
- if ! isConstrained && (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)
4286
+ if (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)
4294
4287
then implicitArgs(formals, argIndex, pt)
4295
4288
else arg :: implicitArgs(formals1, argIndex + 1 , pt)
4296
4289
case failed : SearchFailureType =>
0 commit comments