Skip to content

We should issue warning on class names that differ only in case #1077

Closed
@odersky

Description

@odersky

Given this program

class A
class a

object Test {
  def main(args: Array[String]): Unit = {
    new a
    new A
  }
}

scalac issues this warning:

pos.scala:2: warning: Class a differs only in case from A. Such classes will overwrite one another on case-insensitive filesystems.
class a
      ^

I think dotc should do the same. Also affects pending/run/t920.scala which has a similar problem involving class/object on MacOS and Windows.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions