Skip to content
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

use & support scala 2.13.12 #1861

Merged
merged 1 commit into from Sep 7, 2023
Merged

use & support scala 2.13.12 #1861

merged 1 commit into from Sep 7, 2023

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Sep 7, 2023

Towards #1860

Comment on lines +146 to +147
case i @ Defn.Def(_, name, _, _, _, _) if isUnusedTerm(name.pos) =>
defnTokensToRemove(i).map(Patch.removeTokens).asPatch.atomic
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Compiler warnings for defs are now emitted on a more narrow tree.

--- metap ./scalafix-tests/input/target/jvm-2.13.11/meta/META-INF/semanticdb/scalafix-tests/input/src/main/scala-2/test/removeUnused/RemoveUnusedTerms.scala.semanticdb
+++ metap ./scalafix-tests/input/target/jvm-2.13.12/meta/META-INF/semanticdb/scalafix-tests/input/src/main/scala-2/test/removeUnused/RemoveUnusedTerms.scala.semanticdb

 Diagnostics:
-[7:10..7:10) [warning] procedure syntax is deprecated: instead, add `: Unit =` to explicitly declare `foo`'s return type
+[7:10..7:10) [warning] procedure syntax is deprecated: instead, add `: Unit =` to explicitly declare `foo`'s return type [quickfixable]
 [8:4..8:20) [warning] local val a in method foo is never used
 [9:4..9:23) [warning] local val aa in method foo is never used
 [10:4..10:13) [warning] local var b in method foo is never used
 [11:4..11:23) [warning] local var bb in method foo is never used
-[13:4..13:20) [warning] local method c in method foo is never used
+[13:8..13:9) [warning] local method c in method foo is never used
-[14:4..14:25) [warning] local method cc in method foo is never used
+[14:8..14:10) [warning] local method cc in method foo is never used
 [15:4..15:15) [warning] local val xy in method foo is never used
-[20:2..20:35) [warning] private method ff in object RemoveUnusedTerms is never used
+[20:14..20:16) [warning] private method ff in object RemoveUnusedTerms is never used

Comment on lines 144 to 145
case i: Defn if isUnusedTerm(i.pos) =>
defnTokensToRemove(i).map(Patch.removeTokens).asPatch.atomic
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Keeping the old matcher for compatibility with semanticdb generated with compiler <2.13.12.

@@ -43,11 +43,11 @@ class RuleCompiler(
List(new BatchSourceFile(label, new String(input.chars)))
)
val errors = reporter.infos.collect {
case reporter.Info(pos, msg, reporter.ERROR) =>
case r: reporter.Info if r.severity == reporter.ERROR =>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

avoid using unapply as signature is now inconsistent between 2.12 and 2.13

@bjaglin bjaglin marked this pull request as ready for review September 7, 2023 22:06
@bjaglin bjaglin changed the title use scala 2.13.12 use & support scala 2.13.12 Sep 7, 2023
@bjaglin bjaglin merged commit 92aa828 into scalacenter:main Sep 7, 2023
8 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.

None yet

1 participant