diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-05-12 15:42:28 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-05-12 22:19:02 +0200 |
commit | 966f51c9cb23c788f22dc0b71a534508e3eed4e3 (patch) | |
tree | e616aba6b3fca1f46519d4782f928210d7274678 /src/compiler/scala/tools/reflect/ToolBoxFactory.scala | |
parent | b1538804043bdd7036a6378a9146b685db03a4ba (diff) | |
download | scala-966f51c9cb23c788f22dc0b71a534508e3eed4e3.tar.gz scala-966f51c9cb23c788f22dc0b71a534508e3eed4e3.tar.bz2 scala-966f51c9cb23c788f22dc0b71a534508e3eed4e3.zip |
removes duplication in inferImplicitValue
This is a port of https://github.com/scala/scala/commit/4e64a2731d from 2.10.x.
Diffstat (limited to 'src/compiler/scala/tools/reflect/ToolBoxFactory.scala')
-rw-r--r-- | src/compiler/scala/tools/reflect/ToolBoxFactory.scala | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala index 8512c32361..f81ec610ef 100644 --- a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala +++ b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala @@ -181,14 +181,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf => transformDuringTyper(tree, withImplicitViewsDisabled = false, withMacrosDisabled = withMacrosDisabled)( (currentTyper, tree) => { trace("inferring implicit %s (macros = %s): ".format(if (isView) "view" else "value", !withMacrosDisabled))(showAttributed(pt, true, true, settings.Yshowsymkinds.value)) - val context = currentTyper.context - val result = analyzer.inferImplicit(tree, pt, reportAmbiguous = true, isView = isView, context = context, saveAmbiguousDivergent = !silent, pos = pos) - if (result.isFailure && !silent) { - val err = context.firstError - val errMsg = err.map(_.errMsg).getOrElse("reflective implicit search has failed. to find out the reason, turn on -Xlog-implicits") - throw ToolBoxError(errMsg) - } - result.tree + analyzer.inferImplicit(tree, pt, isView, currentTyper.context, silent, withMacrosDisabled, pos, (pos, msg) => throw ToolBoxError(msg)) }) def compile(expr0: Tree): () => Any = { |