Skip to content

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Mar 13, 2025

@bjaglin bjaglin changed the title build and test against scala 3.7.0 build and test against scala 3.7.0 (WIP RC1) Mar 13, 2025
@bjaglin bjaglin force-pushed the scala37 branch 11 times, most recently from 4a96a16 to ceb4e25 Compare April 12, 2025 18:48
Comment on lines -89 to -91
On Scala 2.13.15+, canonical patterns (vars with the same names as the
attributes) do not trigger unused warnings, so the input above will not
be rewritten. See https://github.com/scala/bug/issues/13035.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

since this is now the default behavior on latest 2.13.x and 3.x, I am removing the "exception" note and documenting it via an example, as it can be surprising

@bjaglin bjaglin force-pushed the scala37 branch 2 times, most recently from 325a956 to 66ea916 Compare April 12, 2025 21:48
@bjaglin bjaglin force-pushed the scala37 branch 2 times, most recently from 93d36c3 to 3a6216e Compare April 12, 2025 23:14
@bjaglin bjaglin changed the title build and test against scala 3.7.0 (WIP RC1) build and test against scala 3.7.0 (WIP RC2) Apr 12, 2025
@bjaglin bjaglin requested a review from Copilot April 13, 2025 23:20
Copy link

@Copilot 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.

Copilot reviewed 12 out of 30 changed files in this pull request and generated no comments.

Files not reviewed (18)
  • project/Dependencies.scala: Language not supported
  • project/Mima.scala: Language not supported
  • project/ScalafixBuild.scala: Language not supported
  • scalafix-cli/src/main/scala/scalafix/internal/interfaces/ScalafixImpl.scala: Language not supported
  • scalafix-rules/src/main/scala/scalafix/internal/rule/RemoveUnused.scala: Language not supported
  • scalafix-rules/src/main/scala/scalafix/internal/rule/RemoveUnusedConfig.scala: Language not supported
  • scalafix-tests/expect/src/test/scala/scalafix/tests/rule/RuleSuite.scala: Language not supported
  • scalafix-tests/input/src/main/scala-2/test/explicitResultTypes/ExplicitResultTypesBase.scala: Language not supported
  • scalafix-tests/input/src/main/scala-2/test/explicitResultTypes/ExplicitResultTypesImplicit.scala: Language not supported
  • scalafix-tests/input/src/main/scala-2/test/removeUnused/RemoveUnusedParams.scala: Language not supported
  • scalafix-tests/input/src/main/scala-2/test/removeUnused/RemoveUnusedPatternVars.scala: Language not supported
  • scalafix-tests/input/src/main/scala-3lts/test/removeUnused/RemoveUnusedPatternVars.scala: Language not supported
  • scalafix-tests/input/src/main/scala-3next/test/explicitResultTypes/ExplicitResultTypesBase.scala: Language not supported
  • scalafix-tests/input/src/main/scala-3next/test/removeUnused/RemoveUnusedParams.scala: Language not supported
  • scalafix-tests/input/src/main/scala-3next/test/removeUnused/RemoveUnusedPatternVars.scala: Language not supported
  • scalafix-tests/integration/src/test/scala/scalafix/tests/interfaces/ScalafixSuite.scala: Language not supported
  • scalafix-tests/output/src/main/scala-2.12/test/removeUnused/RemoveUnusedPatternVars.scala: Language not supported
  • scalafix-tests/output/src/main/scala-2.13/test/removeUnused/RemoveUnusedPatternVars.scala: Language not supported
Comments suppressed due to low confidence (3)

scalafix-interfaces/src/main/java/scalafix/interfaces/Scalafix.java:163

  • Ensure there are tests covering the new '3.7' branch to validate that the expected version is correctly handled.
else if (requestedScalaMajorMinorOrMajorVersion.equals("3.7")) {

docs/rules/RemoveUnused.md:75

  • [nitpick] Consider using canonical pattern variable names consistent with other examples, unless the change is intentional to demonstrate a different naming style.
case AB(foo, bar) => println("Not used")

docs/rules/RemoveUnused.md:93

  • The phrasing 'until Scala 3.7.0' could be ambiguous; consider rephrasing to 'only available starting with Scala 3.7.0' for better clarity.
On Scala 3, an additional `-Wunused:unsafe-warn-patvars` option is required until Scala 3.7.0.

val ff = (_: String) => println("f")
val fs = (used: String, _: Long) => println(used)
def g(x: String => Unit): Unit = ???
g{implicit string => println("g")}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there is no diagnostic for this on the semanticdb emitted by scala 3.7.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a regression from the huge PR about unused settings. I think this might not only be semanticdb.

@bjaglin bjaglin changed the title build and test against scala 3.7.0 (WIP RC2) build and test against scala 3.7.0 (WIP RC3) Apr 14, 2025
@bjaglin bjaglin force-pushed the scala37 branch 2 times, most recently from 72b4f71 to 1cff039 Compare April 15, 2025 18:55
@bjaglin bjaglin changed the title build and test against scala 3.7.0 (WIP RC3) build and test against scala 3.7.0 (WIP RC4) May 2, 2025
@bjaglin bjaglin changed the title build and test against scala 3.7.0 (WIP RC4) build and test against scala 3.7.0 May 6, 2025
@bjaglin bjaglin marked this pull request as ready for review May 6, 2025 16:45
@bjaglin bjaglin merged commit a8644bd into scalacenter:main May 6, 2025
9 checks passed
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.

ExplicitResultTypes breaks compilation when using symbolic methods RemoveUnused: detect unused function parameters in Scala 3

2 participants