Skip to content

Commit 9be384b

Browse files
committed
not infer if type not simplified before implicit search
1 parent ad5ab27 commit 9be384b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4250,10 +4250,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
42504250
else formals1
42514251
implicitArgs(formals2, argIndex + 1, pt)
42524252

4253-
val newctx = ctx.fresh.setNewTyperState()
4253+
val newctx = ctx.fresh.setExploreTyperState()
42544254
val pt1 = pt.deepenProtoTrans(using newctx)
4255-
val arg = if ((pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)(using newctx)) {
4256-
inferImplicitArg(formal, tree.span.endPos)(using newctx)
4255+
val arg = if ((formal.simplified `ne` formal) && (pt1 `ne` pt) && (pt1 ne sharpenedPt) && constrainResult(tree.symbol, wtp, pt1)(using newctx)) {
4256+
inferImplicitArg(formal.simplified(using newctx), tree.span.endPos)
42574257
} else {
42584258
inferImplicitArg(formal, tree.span.endPos)
42594259
}

0 commit comments

Comments
 (0)