Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Friendseeker opened this issue Dec 11, 2023 · 0 comments · Fixed by #19332
Closed

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

Friendseeker opened this issue Dec 11, 2023 · 0 comments · Fixed by #19332

Comments

@Friendseeker
Copy link
Contributor

Friendseeker commented Dec 11, 2023

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?

@Friendseeker Friendseeker added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Dec 11, 2023
@Friendseeker Friendseeker changed the title Raise class file collision as compiler error instead of warning Flag class file collision as compiler error instead of warning Dec 11, 2023
@Friendseeker Friendseeker changed the title Flag class file collision as compiler error instead of warning class file collision is flagged as warning instead of error Dec 11, 2023
@Friendseeker Friendseeker changed the title class file collision is flagged as warning instead of error Class file collision is flagged as warning instead of error Dec 11, 2023
@dwijnand dwijnand added area:backend and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Dec 18, 2023
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants