summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-03-01 17:05:12 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-03-01 18:32:34 -0800
commit09130d55fd6ab0431e37254ecf62bad10bb72c22 (patch)
tree58f97f17901efd9ccf3e26cb30c9f6e28a6300c5 /src/compiler
parent440bf0a8c2545006de1ec70179100742fd73d981 (diff)
downloadscala-09130d55fd6ab0431e37254ecf62bad10bb72c22.tar.gz
scala-09130d55fd6ab0431e37254ecf62bad10bb72c22.tar.bz2
scala-09130d55fd6ab0431e37254ecf62bad10bb72c22.zip
[nomaster] SI-7195 minor version mustn't introduce warnings
We want 2.10.1 to be a drop-in replacement for 2.10.0, so we can't start warning where we weren't warning in 2.10.0. See SI-5954 (#1882, #2079) for when it was an implementation restriction, which was then weakened to a warning. It's now hidden behind -Ydebug.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 4fb68fc2a9..6e9b3b3fcd 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1823,7 +1823,9 @@ trait Typers extends Modes with Adaptations with Tags {
def pkgObjectWarning(m : Symbol, mdef : ModuleDef, restricted : String) = {
val pkgName = mdef.symbol.ownerChain find (_.isPackage) map (_.decodedName) getOrElse mdef.symbol.toString
- context.warning(if (m.pos.isDefined) m.pos else mdef.pos, s"${m} should be placed directly in package ${pkgName} instead of package object ${pkgName}. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.")
+ val pos = if (m.pos.isDefined) m.pos else mdef.pos
+ debugwarn(s"${m} should be placed directly in package ${pkgName} instead of package object ${pkgName}. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.")
+ debugwarn(pos.lineContent + (if (pos.isDefined) " " * (pos.column - 1) + "^" else ""))
}
}