Skip to content

Commit 54a9f1b

Browse files
committed
Merge pull request scala#2189 from adriaanm/ticket-7195
[nomaster] SI-7195 minor version mustn't introduce warnings
2 parents 440bf0a + 09130d5 commit 54a9f1b

File tree

4 files changed

+3
-64
lines changed

4 files changed

+3
-64
lines changed

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,9 @@ trait Typers extends Modes with Adaptations with Tags {
18231823

18241824
def pkgObjectWarning(m : Symbol, mdef : ModuleDef, restricted : String) = {
18251825
val pkgName = mdef.symbol.ownerChain find (_.isPackage) map (_.decodedName) getOrElse mdef.symbol.toString
1826-
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.")
1826+
val pos = if (m.pos.isDefined) m.pos else mdef.pos
1827+
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.")
1828+
debugwarn(pos.lineContent + (if (pos.isDefined) " " * (pos.column - 1) + "^" else ""))
18271829
}
18281830
}
18291831

test/files/neg/t5954.check

Lines changed: 0 additions & 16 deletions
This file was deleted.

test/files/neg/t5954.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/neg/t5954.scala

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)