Skip to content

Commit 29d7656

Browse files
committed
address review: resolve type args in fresh context
1 parent 6b71880 commit 29d7656

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ trait Implicits { self: Typer =>
704704
params,
705705
args)
706706
}
707+
def resolveTypes(targs: List[tpd.Tree])(implicit ctx: Context) = targs.map(a => fullyDefinedType(a.typeOpt, "type parameter", a.pos))
707708
arg.tpe match {
708709
case ambi: AmbiguousImplicits =>
709710
val maybeAnnot = ambi.alt1.ref.symbol.getAnnotation(defn.ImplicitAmbiguousAnnot).map(
@@ -718,11 +719,10 @@ trait Implicits { self: Typer =>
718719
case lambda: TypeLambda => lambda.typeParams.map(_.paramName.unexpandedName.toString)
719720
case _ => Nil
720721
}
721-
alt.tstate.commit()
722722
val args = alt.tree match {
723723
case TypeApply(_, targs) if params.nonEmpty =>
724-
targs.map(a => fullyDefinedType(a.typeOpt, "type parameter", a.pos))
725-
case _ =>
724+
resolveTypes(targs)(ctx.fresh.setTyperState(alt.tstate))
725+
case _ =>
726726
Nil
727727
}
728728
userDefinedMessage(annot, params, args)

0 commit comments

Comments
 (0)