From ee6fbae3d069d8fe55b7a20756c04abcc9119bba Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 14 Nov 2013 12:17:07 +0100 Subject: correctly fails implicit search for invalid implicit macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was a rare corner case when implicit search wouldn’t discard an invalid implicit macro (e.g. the one with mismatching macro impl or the one with macro impl defined in the same compilation run) during typechecking the corresponding candidate in typedImplicit1. This is now fixed. --- src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/compiler/scala/tools') diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 01acbb8cc2..d31a8e81d4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -664,6 +664,8 @@ trait Implicits { if (context.hasErrors) fail("hasMatchingSymbol reported error: " + context.firstError.get.errMsg) + else if (itree3.isErroneous) + fail("error typechecking implicit candidate") else if (isLocal && !hasMatchingSymbol(itree2)) fail("candidate implicit %s is shadowed by %s".format( info.sym.fullLocationString, itree2.symbol.fullLocationString)) -- cgit v1.2.3