Skip to content

Commit 841dbc9

Browse files
committed
removing defensive code made obsolete by existing fix to SI-5604
SI-5604 was fixed in commit e6f10b0
1 parent c4e37d6 commit 841dbc9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,12 +856,11 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
856856
}
857857

858858
def genLoadModule(tree: Tree): BType = {
859-
// Working around SI-5604. Rather than failing the compile when we see a package here, check if there's a package object.
860859
val module = (
861860
if (!tree.symbol.isPackageClass) tree.symbol
862861
else tree.symbol.info.member(nme.PACKAGE) match {
863-
case NoSymbol => abort(s"Cannot use package as value: $tree") ; NoSymbol
864-
case s => devWarning("Bug: found package class where package object expected. Converting.") ; s.moduleClass
862+
case NoSymbol => abort(s"SI-5604: Cannot use package as value: $tree")
863+
case s => abort(s"SI-5604: found package class where package object expected: $tree")
865864
}
866865
)
867866
lineNumber(tree)

src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,11 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
440440
if (sym0 == definitions.NullClass) return RT_NULL;
441441
if (sym0 == definitions.NothingClass) return RT_NOTHING;
442442

443-
// Working around SI-5604. Rather than failing the compile when we see
444-
// a package here, check if there's a package object.
445443
val sym = (
446444
if (!sym0.isPackageClass) sym0
447445
else sym0.info.member(nme.PACKAGE) match {
448-
case NoSymbol => abort(s"Cannot use package as value: ${sym0.fullName}")
449-
case s => devWarning("Bug: found package class where package object expected. Converting.") ; s.moduleClass
446+
case NoSymbol => abort(s"SI-5604: Cannot use package as value: ${sym0.fullName}")
447+
case s => abort(s"SI-5604: found package class where package object expected: $s")
450448
}
451449
)
452450

0 commit comments

Comments
 (0)