summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-04-21 20:32:45 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-04-21 20:32:45 +0200
commit9ecb5c6423e55bd728621f79daf0c7c927bf41df (patch)
treeeb3db2d2e414445774c520feb3a30516a22bec32 /src
parent7753e60685f08d0a7f6c3bed24dab7f2811a5f28 (diff)
parent92460c57eb7a0a8cfcff563d868aa39015f0b764 (diff)
downloadscala-9ecb5c6423e55bd728621f79daf0c7c927bf41df.tar.gz
scala-9ecb5c6423e55bd728621f79daf0c7c927bf41df.tar.bz2
scala-9ecb5c6423e55bd728621f79daf0c7c927bf41df.zip
Merge pull request #3658 from adriaanm/t8450
SI-8450 no "implicit numeric widening" in silent mode
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 9f557f4aa5..e3901be546 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1041,11 +1041,11 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
if (tree.tpe <:< AnyTpe) pt.dealias match {
case TypeRef(_, UnitClass, _) => // (12)
if (settings.warnValueDiscard)
- context.unit.warning(tree.pos, "discarded non-Unit value")
+ context.warning(tree.pos, "discarded non-Unit value")
return typedPos(tree.pos, mode, pt)(Block(List(tree), Literal(Constant(()))))
case TypeRef(_, sym, _) if isNumericValueClass(sym) && isNumericSubType(tree.tpe, pt) =>
if (settings.warnNumericWiden)
- context.unit.warning(tree.pos, "implicit numeric widening")
+ context.warning(tree.pos, "implicit numeric widening")
return typedPos(tree.pos, mode, pt)(Select(tree, "to" + sym.name))
case _ =>
}
@@ -5109,7 +5109,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
def isPlausible(m: Symbol) = m.alternatives exists (m => requiresNoArgs(m.info))
def maybeWarn(s: String): Unit = {
- def warn(message: String) = context.unit.warning(lit.pos, s"$message Did you forget the interpolator?")
+ def warn(message: String) = context.warning(lit.pos, s"$message Did you forget the interpolator?")
def suspiciousSym(name: TermName) = context.lookupSymbol(name, _ => true).symbol
def suspiciousExpr = InterpolatorCodeRegex findFirstIn s
def suspiciousIdents = InterpolatorIdentRegex findAllIn s map (s => suspiciousSym(s drop 1))