-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #2681: re-enable check for potentially overridden classfiles #3897
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Added" instead of "Add")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
I'm not sure it's worth adding a mini-phase for this. There is already code in the backend to do this kind of check that just needs to be enabled I think: https://github.com/lampepfl/dotty/blob/3004af37018d2f64c08f33500becf939141ec2e8/compiler/src/dotty/tools/backend/jvm/GenBCode.scala#L190-L202 see #1077 |
The problem with the miniphase approach is that it catches only files declared in the same sourcefile. A backend solution is better because it is more complete, IMO. |
"Such classes will overwrite one another on case-insensitive filesystems." | ||
) | ||
}*/ | ||
ctx.warning(s"Class ${claszSymbol.name.toString.toLowerCase} differs only in case from ${dupClassSym.name.toString}. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the old error message, if you convert to lower case, the user won't see the differences.
tests/neg/i2673.scala
Outdated
@@ -0,0 +1,4 @@ | |||
package Foos //error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into neg-custom-args
and be compiled with -Xfatal-warnings
. Here is an example https://github.com/lampepfl/dotty/blob/78bd3dd8ce5822171ccf252864e2e5c3d76747a4/compiler/test/dotty/tools/dotc/CompilationTests.scala#L197
I have too many things to review. |
If this is merged #1077 can be closed as well. |
…ages for error reporting
LGTM |
No description provided.