diff options
author | Paul Phillips <paulp@improving.org> | 2012-05-03 09:33:05 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-05-03 10:50:51 -0700 |
commit | 8068e1208466ab17af40c2670230ba5ac9704e0c (patch) | |
tree | 83903e07f5cae626affc555c2fffabba5afed15d | |
parent | aad241e863ccfe7b3f7c4ee61824e7fad7f838c8 (diff) | |
download | scala-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."
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 2 | ||||
-rw-r--r-- | test/files/neg/package-ob-case.flags | 2 |
2 files changed, 2 insertions, 2 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." diff --git a/test/files/neg/package-ob-case.flags b/test/files/neg/package-ob-case.flags index e8fb65d50c..6c1dd108ae 100644 --- a/test/files/neg/package-ob-case.flags +++ b/test/files/neg/package-ob-case.flags @@ -1 +1 @@ --Xfatal-warnings
\ No newline at end of file +-Xfatal-warnings -Xlint
\ No newline at end of file |