summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-05-03 09:33:05 -0700
committerPaul Phillips <paulp@improving.org>2012-05-03 10:50:51 -0700
commit8068e1208466ab17af40c2670230ba5ac9704e0c (patch)
tree83903e07f5cae626affc555c2fffabba5afed15d /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parentaad241e863ccfe7b3f7c4ee61824e7fad7f838c8 (diff)
downloadscala-8068e1208466ab17af40c2670230ba5ac9704e0c.tar.gz
scala-8068e1208466ab17af40c2670230ba5ac9704e0c.tar.bz2
scala-8068e1208466ab17af40c2670230ba5ac9704e0c.zip
Moved a warning behind -Xlint.
Eventually "-Xlint would have told you not to do that" will be a catchphrase, like "I love it when a plan comes together" or "respect mah authoritah."
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 4e7dac890b..e4296774a1 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -627,7 +627,7 @@ trait Namers extends MethodSynthesis {
classAndNamerOfModule(m) = (tree, null)
}
val owner = tree.symbol.owner
- if (owner.isPackageObjectClass) {
+ if (settings.lint.value && owner.isPackageObjectClass) {
context.unit.warning(tree.pos,
"it is not recommended to define classes/objects inside of package objects.\n" +
"If possible, define " + tree.symbol + " in " + owner.skipPackageObject + " instead."