summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2012-05-22 15:29:20 +0200
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2012-05-22 15:29:20 +0200
commit1d7625306b7aad86408ae191e4019a9558685fa8 (patch)
tree5c67e132746a0856311f42b4a56781723446e4f1 /src
parent29c8e323c589058a0668a249a39fec28293c45ca (diff)
downloadscala-1d7625306b7aad86408ae191e4019a9558685fa8.tar.gz
scala-1d7625306b7aad86408ae191e4019a9558685fa8.tar.bz2
scala-1d7625306b7aad86408ae191e4019a9558685fa8.zip
Better diagnosis for the SI-5044 fix
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala4
1 files changed, 4 insertions, 0 deletions
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