summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-11-22 14:12:43 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-11-22 14:26:22 +0100
commit3719f790f301852b85dcd95b401c921e286d4e1e (patch)
treed5d6d1dc2e765b6995993540603406a7df3a4f1b /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parenta0e642b7fe608b869071b690e7907b934b10db5a (diff)
downloadscala-3719f790f301852b85dcd95b401c921e286d4e1e.tar.gz
scala-3719f790f301852b85dcd95b401c921e286d4e1e.tar.bz2
scala-3719f790f301852b85dcd95b401c921e286d4e1e.zip
Refactor use of SearchFailure in implicits.
Introduces AmbiguousSearchFailure to go with the the existing SearchFailure, and changes predicates to use `SearchResult.{isFailure, isSuccess}`. This doesn't change behaviour; it is a preparatory commit for SI-6667.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 222c9ff8c3..70fbc90ce3 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -132,7 +132,7 @@ trait Typers extends Modes with Adaptations with Tags {
val res = if (paramFailed || (paramTp.isError && {paramFailed = true; true})) SearchFailure else inferImplicit(fun, paramTp, context.reportErrors, false, context)
argResultsBuff += res
- if (res != SearchFailure) {
+ if (res.isSuccess) {
argBuff += mkArg(res.tree, param.name)
} else {
mkArg = mkNamedArg // don't pass the default argument (if any) here, but start emitting named arguments for the following args
@@ -761,7 +761,7 @@ trait Typers extends Modes with Adaptations with Tags {
featureTrait.owner.ownerChain.takeWhile(_ != languageFeatureModule.moduleClass).reverse
val featureName = (nestedOwners map (_.name + ".")).mkString + featureTrait.name
def action(): Boolean = {
- def hasImport = inferImplicit(EmptyTree: Tree, featureTrait.tpe, true, false, context) != SearchFailure
+ def hasImport = inferImplicit(EmptyTree: Tree, featureTrait.tpe, true, false, context).isSuccess
def hasOption = settings.language.value exists (s => s == featureName || s == "_")
val OK = hasImport || hasOption
if (!OK) {