summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/macros/runtime
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-04-10 11:52:01 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-04-21 13:01:03 +0200
commitec5eaee3ec27b614c3ffe0496a755623c912cfdd (patch)
treed08a45df201ee77532b0f9b790315c3a114ffc5c /src/compiler/scala/reflect/macros/runtime
parent190aea9f015280d0f48cc2928515d11eccce4e33 (diff)
downloadscala-ec5eaee3ec27b614c3ffe0496a755623c912cfdd.tar.gz
scala-ec5eaee3ec27b614c3ffe0496a755623c912cfdd.tar.bz2
scala-ec5eaee3ec27b614c3ffe0496a755623c912cfdd.zip
SI-7345 More refactoring and documentation in Contexts
- Use `firstError match {}` rather than `if (c.hasErrors) c.firstError ..` - Convert implementation comments to doc comments - Add new doc comments - Refactor `Context#make` for better readability. - Note a few TODOs. - Roughly delineate the internal structure of Contexts with comments. - Combine `mode` and `state` methods into `contextMode`. - Move `isNameInScope` closer to its compadres. - Improving alignment, tightening access.
Diffstat (limited to 'src/compiler/scala/reflect/macros/runtime')
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Typers.scala7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/Typers.scala b/src/compiler/scala/reflect/macros/runtime/Typers.scala
index 99b934787d..79833d155e 100644
--- a/src/compiler/scala/reflect/macros/runtime/Typers.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Typers.scala
@@ -54,11 +54,10 @@ trait Typers {
wrapper(universe.analyzer.inferImplicit(tree, pt, reportAmbiguous = true, isView = isView, context = context, saveAmbiguousDivergent = !silent, pos = pos)) match {
case failure if failure.tree.isEmpty =>
macroLogVerbose("implicit search has failed. to find out the reason, turn on -Xlog-implicits")
- if (context.hasErrors) {
- val err = context.firstError
- throw new TypecheckException(err.errPos, err.errMsg)
+ context.firstError match {
+ case Some(err) => throw new TypecheckException(err.errPos, err.errMsg)
+ case None => universe.EmptyTree
}
- universe.EmptyTree
case success =>
success.tree
}