Skip to content

Conversation

@EnviousSwan
Copy link

@EnviousSwan EnviousSwan commented Jan 14, 2026

Closes #219


Getting this error with Scala 3.8.0 and sbt-tpolecat 0.5.2

[warn] Option -Xfatal-warnings is a deprecated alias: use -Werror instead
[error] No warnings can be incurred under -Werror

@EnviousSwan EnviousSwan marked this pull request as ready for review January 14, 2026 10:54
Copilot AI review requested due to automatic review settings January 14, 2026 10:54
Copy link

Copilot AI left a 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-warnings for Scala 3.8.0 and later
  • Enable -Werror for 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.
Copy link

Copilot AI Jan 14, 2026

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.

Suggested change
/** 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.03.7.x) do not support
* this flag in a compatible way, so `-Werror` is intentionally not enabled there.

Copilot uses AI. Check for mistakes.
Copy link
Author

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 🤔

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-Xfatal-warnings is deprecated since Scala 3.8

2 participants