Skip to content

Tweak -Wconf:help for correctness#25615

Open
som-snytt wants to merge 1 commit intoscala:mainfrom
som-snytt:issue/19885-wconf-help
Open

Tweak -Wconf:help for correctness#25615
som-snytt wants to merge 1 commit intoscala:mainfrom
som-snytt:issue/19885-wconf-help

Conversation

@som-snytt
Copy link
Copy Markdown
Contributor

@som-snytt som-snytt commented Mar 25, 2026

Fixes #19885

Used no LLM except Lukas the Language Manager on Scala 2. All remaining faults are my own, however.

@som-snytt
Copy link
Copy Markdown
Contributor Author

Per current behavior.

scala-cli repl --server=false -S 3.8.2 -Wall -Wconf:any:e -Wconf:cat=deprecation:s
Welcome to Scala 3.8.2 (25, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> 42 formatted "%d"
val res0: String = "42"

scala> class C { private val x = 42 }
-- [E198] Unused Symbol Error: -------------------------------------------------
1 |class C { private val x = 42 }
  |                      ^
  |                      unused private member
1 error found

scala>

just checking...

scala-cli repl --server=false -S 3.8.2 -Wall -deprecation
Welcome to Scala 3.8.2 (25, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> 42 `formatted` "%d?"
1 warning found
-- Deprecation Warning: --------------------------------------------------------
1 |42 `formatted` "%d?"
  |^^^^^^^^^^^^^^
  |method formatted in class StringFormat is deprecated since 2.12.16: Use `formatString.format(value)` instead of `value.formatted(formatString)`,
  |or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters.
val res0: String = "42?"

scala> "hi".formatted("%s!")
val res1: String = "hi"

scala>

@som-snytt som-snytt requested a review from lrytz March 25, 2026 01:04
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.

Clarify -Wconf:help that last setting wins, including in comma-separated setting text

1 participant