Skip to content

Update scalacOptions for Scala 3.8#860

Open
xuwei-k wants to merge 1 commit intotypelevel:mainfrom
xuwei-k:scala-3-8
Open

Update scalacOptions for Scala 3.8#860
xuwei-k wants to merge 1 commit intotypelevel:mainfrom
xuwei-k:scala-3-8

Conversation

@xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Jan 7, 2026

No description provided.

@mergify mergify bot added the settings label Jan 7, 2026
Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh drat, sorry. My review was stuck in "pending" for a week 😅

Thanks for the PR. I had one thought.

javaOutputVersionOption
case Some(n) =>
log.warn(s"tlJdkRelease is ${n} but scala ${scalaVersion.value} require JDK 17")
Seq.empty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Seq.empty
Seq("-java-output-version", 17)

I think returning Seq.empty here is the wrong behavior. Instead, we should bump the JDK release to 17.

To explain why: developers specify this flag so that the compiler prevents them from using JDK APIs that are too new. For example, APIs introduced in Java 21. Even if a JDK release version of 8 or 11 is no longer compatible with Scala 3.8+, we should still ensure that the compiler will prevent the use of APIs from JDKs >17.

In fact, I would even say the warning would just be noise and we can make this adjustment silently. By choosing to use Scala 3.8+, the developer is already opting-in to minimum JDK 17+.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants