-
-
Notifications
You must be signed in to change notification settings - Fork 15
Deprecate -Xfatal-warnings option for Scala 3.8+ #225
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
base: main
Are you sure you want to change the base?
Deprecate -Xfatal-warnings option for Scala 3.8+ #225
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.
Pull request overview
This PR updates the library to handle the deprecation of the -Xfatal-warnings option in Scala 3.8.0, which is now replaced by -Werror. The change ensures compatibility with Scala 3.8.0+ by conditionally applying the appropriate compiler flag based on the Scala version.
Changes:
- Deprecate
-Xfatal-warningsfor Scala 3.8.0 and later - Enable
-Werrorfor Scala 3.8.0 and later - Add version constant for Scala 3.8.0
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala | Updated version constraints for fatalWarnings and warnError options to handle the transition from -Xfatal-warnings to -Werror at Scala 3.8.0 |
| lib/src/main/scala/org/typelevel/scalacoptions/ScalaVersion.scala | Added V3_8_0 constant to support version-specific logic for Scala 3.8.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| version => version.isBetween(V2_13_9, V3_0_0) || version.isAtLeast(V3_3_1) | ||
| ) | ||
|
|
||
| /** Fail the compilation if there are any warnings. |
Copilot
AI
Jan 14, 2026
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.
The condition for enabling -Werror has a gap between Scala 3.0.0 and 3.8.0. Consider clarifying whether this gap is intentional or if the logic should cover the intermediate versions. If -Werror is not available in Scala 3.0.0-3.7.x, this is correct, but a comment explaining this gap would improve maintainability.
| /** Fail the compilation if there are any warnings. | |
| /** Fail the compilation if there are any warnings. | |
| * | |
| * Scala 2.13 exposes this as `-Xfatal-warnings` / `-Werror`, and Scala 3 reintroduces | |
| * `-Werror` starting from 3.8.0. Earlier Scala 3 versions (3.0.0–3.7.x) do not support | |
| * this flag in a compatible way, so `-Werror` is intentionally not enabled there. |
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.
it seems like it's been supported since 3.0.2-RC1 🤔
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'd ignore this suggestion from AI and keep the option -Werror active starting with 3.8.0 to avoid any regression on user side who might have relied on -Xfatal-warnings before.
your code LGTM. Thank you!
Closes #219
Getting this error with Scala 3.8.0 and
sbt-tpolecat0.5.2