aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index 489233f90..ec2f46d5d 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -82,7 +82,7 @@ object Implicits {
* @param tree The typed tree that can needs to be inserted
* @param ctx The context after the implicit search
*/
- case class SearchSuccess(ref: TermRef, tree: tpd.Tree, ctx: Context) extends SearchResult
+ case class SearchSuccess(ref: TermRef, tree: tpd.Tree, tstate: TyperState) extends SearchResult
/** A failed search */
abstract class SearchFailure extends SearchResult
@@ -184,8 +184,8 @@ trait Implicits { self: Typer =>
*/
def inferImplicit(pt: Type, argument: Tree, pos: Position, reportAmbiguous: Boolean = true)(implicit ctx: Context): Tree = {
new ImplicitSearch(pt, argument, pos).bestImplicit match {
- case SearchSuccess(_, tree, newCtx) =>
- newCtx.typerState.commit()
+ case SearchSuccess(_, tree, tstate) =>
+ tstate.commit()
tree
case NoImplicitMatches =>
EmptyTree
@@ -210,7 +210,7 @@ trait Implicits { self: Typer =>
if (argument.isEmpty) adapt(id, Mode.Expr, pt)
else typedApply(id, ref, argument :: Nil, pt)
if (tree.tpe.isError) NoImplicitMatches // todo: replace by checking if local errors were reported in ctx.
- else SearchSuccess(ref, tree, ctx)
+ else SearchSuccess(ref, tree, ctx.typerState)
}
/** Given a list of implicit references, produce a list of all implicit search successes,