Permalink
Browse files

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.
  • Loading branch information...
1 parent 190aea9 commit ec5eaee3ec27b614c3ffe0496a755623c912cfdd @retronym retronym committed Apr 10, 2013
@@ -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
}
Oops, something went wrong.

1 comment on commit ec5eaee

@scala-jenkins

Job pr-checkin-per-commit failed for ec5eaee (results):


Took 111 min.
to rebuild, comment "PLS REBUILD/pr-checkin-per-commit@ec5eaee" on PR 2393

Please sign in to comment.