Skip to content

Commit 6394bef

Browse files
Friendseekertgodzik
authored andcommitted
Flag class file collision as error
[Cherry-picked 632278e]
1 parent e04ea4a commit 6394bef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/backend/jvm/PostProcessor.scala

Lines changed: 1 addition & 1 deletion
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(

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

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

0 commit comments

Comments
 (0)