Skip to content

Class file collision is flagged as warning instead of error #19248

Closed
@Friendseeker

Description

@Friendseeker

Issue

For the following compiler warning

[warn] -- Warning: /Users/jiahuitan/sbt-zinc-compilation-bug/src/main/scala/Foo.scala:1:6 
[warn] 1 |trait Foo {
[warn]   |      ^
[warn]   |      trait Foo and object Foo produce classes that overwrite one another
[warn] one warning found

(Trait Foo, Object Foo are declared in different source file)

The fact that compilation succeeds is causing an infinite compilation bug in Zinc (sbt/zinc#1187).

Expected

Scala 2 throws error for such class file collision. Would it be possible for Dotty to have same behaviour as Scala 2 compiler?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions