Skip to content

Commit

Permalink
Flag class file collision as error
Browse files Browse the repository at this point in the history
  • Loading branch information
Friendseeker committed Oct 9, 2024
1 parent cd3bd1d commit 632278e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/backend/jvm/PostProcessor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PostProcessor(val frontendAccess: PostProcessorFrontendAccess, val bTypes:
else s" (defined in ${pos2.source.file.name})"
def nicify(name: String): String = name.replace('/', '.').nn
if name1 == name2 then
backendReporting.warning(
backendReporting.error(
em"${nicify(name1)} and ${nicify(name2)} produce classes that overwrite one another", pos1)
else
backendReporting.warning(
Expand Down
2 changes: 1 addition & 1 deletion tests/pos-with-compiler-cc/backend/jvm/GenBCode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
val same = classSymbol.effectiveName.toString == dupClassSym.effectiveName.toString
atPhase(typerPhase) {
if (same)
report.warning( // FIXME: This should really be an error, but then FromTasty tests fail
report.error(
em"$cl1 and ${cl2.showLocated} produce classes that overwrite one another", cl1.sourcePos)
else
report.warning(
Expand Down

0 comments on commit 632278e

Please sign in to comment.