summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-07-08 16:43:39 +0200
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-07-17 15:46:47 +0200
commitac6dcad89a0121d5c5c78e373fe691a56f1103d4 (patch)
tree25b3317bad46500bc6a77a2d1a51efaa2266a388
parenta7407468be46799619f1b7ebe1f0975f3a6c2dbb (diff)
downloadscala-ac6dcad89a0121d5c5c78e373fe691a56f1103d4.tar.gz
scala-ac6dcad89a0121d5c5c78e373fe691a56f1103d4.tar.bz2
scala-ac6dcad89a0121d5c5c78e373fe691a56f1103d4.zip
Extract the `makeNonSilent` method.
Setting the scene of removing the reporting mode bits from `contextMode`.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala6
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 7cb2ad7ac5..695932c870 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -490,6 +490,12 @@ trait Contexts { self: Analyzer =>
c
}
+ def makeNonSilent(newtree: Tree): Context = {
+ val c = make(newtree)
+ c.setReportErrors()
+ c
+ }
+
/** Make a silent child context does not allow implicits. Used to prevent chaining of implicit views. */
def makeImplicit(reportAmbiguousErrors: Boolean) = {
val c = makeSilent(reportAmbiguousErrors)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 7bbd81118a..fdff2f3076 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1494,8 +1494,7 @@ trait Namers extends MethodSynthesis {
case defn: MemberDef =>
val ainfos = defn.mods.annotations filterNot (_ eq null) map { ann =>
val ctx = typer.context
- val annCtx = ctx.make(ann)
- annCtx.setReportErrors()
+ val annCtx = ctx.makeNonSilent(ann)
// need to be lazy, #1782. beforeTyper to allow inferView in annotation args, SI-5892.
AnnotationInfo lazily {
enteringTyper(newTyper(annCtx) typedAnnotation ann)