@@ -24,6 +24,8 @@ import Contexts._
24
24
import Types ._
25
25
import Symbols ._
26
26
import Denotations ._
27
+ import Decorators ._
28
+
27
29
import Phases ._
28
30
import java .lang .AssertionError
29
31
import java .io .{DataOutputStream , File => JFile }
@@ -188,18 +190,19 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
188
190
val claszSymbol = cd.symbol
189
191
190
192
// GenASM checks this before classfiles are emitted, https://github.com/scala/scala/commit/e4d1d930693ac75d8eb64c2c3c69f2fc22bec739
191
- // todo: add back those checks
192
- /* val lowercaseJavaClassName = claszSymbol.javaClassName.toLowerCase
193
+ val lowercaseJavaClassName = claszSymbol.name.toString.toLowerCase
193
194
caseInsensitively.get(lowercaseJavaClassName) match {
194
195
case None =>
195
196
caseInsensitively.put(lowercaseJavaClassName, claszSymbol)
196
197
case Some (dupClassSym) =>
197
- reporter.warning(
198
- claszSymbol.pos,
199
- s"Class ${claszSymbol.javaClassName} differs only in case from ${dupClassSym.javaClassName}. " +
200
- "Such classes will overwrite one another on case-insensitive filesystems."
201
- )
202
- }*/
198
+ // Order is not deterministic so we enforce lexicographic order between the duplicates for error-reporting
199
+ if (claszSymbol.name.toString < dupClassSym.name.toString)
200
+ ctx.warning(s " Class ${claszSymbol.name} differs only in case from ${dupClassSym.name}. " +
201
+ " Such classes will overwrite one another on case-insensitive filesystems." , claszSymbol.pos)
202
+ else
203
+ ctx.warning(s " Class ${dupClassSym.name} differs only in case from ${claszSymbol.name}. " +
204
+ " Such classes will overwrite one another on case-insensitive filesystems." , dupClassSym.pos)
205
+ }
203
206
204
207
// -------------- mirror class, if needed --------------
205
208
val mirrorC =
0 commit comments