Permalink
Browse files

Better diagnosis for the SI-5044 fix

  • Loading branch information...
hubertp committed May 22, 2012
1 parent 29c8e32 commit 1d7625306b7aad86408ae191e4019a9558685fa8
Showing with 4 additions and 0 deletions.
  1. +4 −0 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

0 comments on commit 1d76253

Please sign in to comment.