Skip to content

Commit deb9456

Browse files
committed
Flag class file collision as error
1 parent 938d405 commit deb9456

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: compiler/src/dotty/tools/backend/jvm/PostProcessor.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PostProcessor(val frontendAccess: PostProcessorFrontendAccess, val bTypes:
7373
else s" (defined in ${pos2.source.file.name})"
7474
def nicify(name: String): String = name.replace('/', '.').nn
7575
if name1 == name2 then
76-
backendReporting.warning(
76+
backendReporting.error(
7777
em"${nicify(name1)} and ${nicify(name2)} produce classes that overwrite one another", pos1)
7878
else
7979
backendReporting.warning(

Diff for: tests/pos-with-compiler-cc/backend/jvm/GenBCode.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
214214
val same = classSymbol.effectiveName.toString == dupClassSym.effectiveName.toString
215215
atPhase(typerPhase) {
216216
if (same)
217-
report.warning( // FIXME: This should really be an error, but then FromTasty tests fail
217+
report.error(
218218
em"$cl1 and ${cl2.showLocated} produce classes that overwrite one another", cl1.sourcePos)
219219
else
220220
report.warning(

0 commit comments

Comments
 (0)