-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix/suppress warnings in kernel and kernel-laws #4614
Conversation
Note: not all the warnings have been fixed. There are a bunch of warnings like these below that still remain:
Such warnings get emitted by Scala3 only and the renamed We can fix them by removing those import renames and using |
@@ -83,7 +83,9 @@ class SeqMonoid[A] extends Monoid[Seq[A]] { | |||
} | |||
|
|||
object SeqMonoid { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to not just deprecate SeqMonoid
but also make it private [cats]
:
cats/kernel/src/main/scala/cats/kernel/instances/SeqInstances.scala
Lines 73 to 74 in 17d7e95
@deprecated("Use SeqMonoid.apply, which does not allocate a new instance", "2.9.0") | |
class SeqMonoid[A] extends Monoid[Seq[A]] { |
Looks like SeqMonoid
is not supposed to be user-facing, so it should be a fairly safe change.
It would be out of scope of this PR, of course, but if it makes sense, I can do it here, because it is still related to the warnings cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be a source breaking change for whoever used it that way. Even though they shouldn't use it, it's nice to make it very clear how to fix it. I don't tend to like to remove deprecations until keeping them causes pain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the best strategy here would be to provide a scalafix rule for that. But it would definitely come out of the scope of this PR.
Removed the |
and not even the most exotic species. Thanks for the ticket, I seized the opportunity and submitted a fix for the unused import. I wonder if they would accept a SIP to add 2-letter aliases for all the standard annotations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
kernel-laws/shared/src/main/scala/cats/kernel/laws/discipline/BoundedTests.scala
Outdated
Show resolved
Hide resolved
kernel-laws/shared/src/main/scala/cats/kernel/laws/discipline/BoundedTests.scala
Outdated
Show resolved
Hide resolved
@@ -83,7 +83,9 @@ class SeqMonoid[A] extends Monoid[Seq[A]] { | |||
} | |||
|
|||
object SeqMonoid { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be a source breaking change for whoever used it that way. Even though they shouldn't use it, it's nice to make it very clear how to fix it. I don't tend to like to remove deprecations until keeping them causes pain.
1a8aa58
to
c2bdebf
Compare
Supersedes #4187.
This PR fixes or suppresses compiler warnings in the kernel and kernel-laws modules.