summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-05-22 15:19:23 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-05-22 15:19:23 -0700
commitc842ef3097a0ef5acb98fa85140f24f367885468 (patch)
treea4aa2fb1cef89aebd62f53197af5cb17cc6b0a66 /src
parent15e3f8c2cfbff2b4080daf6a6f7ecb233f45b456 (diff)
parent1d7625306b7aad86408ae191e4019a9558685fa8 (diff)
downloadscala-c842ef3097a0ef5acb98fa85140f24f367885468.tar.gz
scala-c842ef3097a0ef5acb98fa85140f24f367885468.tar.bz2
scala-c842ef3097a0ef5acb98fa85140f24f367885468.zip
Merge pull request #604 from hubertp/issue/5044
More info regarding SI-5044. Already discussed with @lrytz.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 0924789948..29249023b9 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -438,8 +438,8 @@ trait Contexts { self: Analyzer =>
def enclosingContextChain: List[Context] = this :: outer.enclosingContextChain
- override def toString = "Context(%s@%s unit=%s scope=%s errors=%b)".format(
- owner.fullName, tree.shortClass, unit, scope.##, hasErrors
+ override def toString = "Context(%s@%s unit=%s scope=%s errors=%b, reportErrors=%b, throwErrors=%b)".format(
+ owner.fullName, tree.shortClass, unit, scope.##, hasErrors, reportErrors, throwErrors
)
/** Is `sub` a subclass of `base` or a companion object of such a subclass?
*/
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index 88e464a1f4..d1f319311e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -482,6 +482,10 @@ trait NamesDefaults { self: Analyzer =>
try typer.silent { tpr =>
val res = tpr.typed(arg, subst(paramtpe))
// better warning for SI-5044: if `silent` was not actually silent give a hint to the user
+ // [H]: the reason why `silent` is not silent is because the cyclic reference exception is
+ // thrown in a context completely different from `context` here. The exception happens while
+ // completing the type, and TypeCompleter is created/run with a non-silent Namer `context`
+ // and there is at the moment no way to connect the two unless we go through some global state.
if (errsBefore < reporter.ERROR.count)
WarnAfterNonSilentRecursiveInference(param, arg)(context)
res