-
Notifications
You must be signed in to change notification settings - Fork 67
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
Update scala-library to 2.13.9 #370
Conversation
Executed command: sbt githubWorkflowGenerate
@@ -32,6 +30,10 @@ trait MouseFunctions { | |||
* @param a | |||
* - the value to be evaluated and ignored. | |||
*/ | |||
def ignore(@nowarn a: Any): Unit = () |
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.
According to the new behavior in Scala 2.13.9, this @nowarn
was marked as unused.
home/runner/work/mouse/mouse/shared/src/main/scala/mouse/MouseFunctions.scala:35:15: @nowarn annotation does not suppress any warnings
[error] def ignore(@nowarn a: Any): Unit = ()
And it's done intentionally. So we had to handle this issue with some workaround.
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.
@benhutchison your thoughts on this would be appreciated.
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.
Annoying and ironic that suppressing warnings generates a warning!
But if there's no warning, can we remove the annotation?
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.
This new behavior is only for 2.13.9. So, if we just remove the annotation, then for 2.12 and 3 that will cause warnings about unused function argument.
This is such an incompatible change! Maybe we hold off on 2.13.9 and see if
they reverse it due to popular outcry?
Alternative would be a version specific source file but that's a lot of
bother for such a small issue..
…On Sun, 25 Sept 2022, 5:50 pm Daniel Esik, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In shared/src/main/scala/mouse/MouseFunctions.scala
<#370 (comment)>:
> @@ -32,6 +30,10 @@ trait MouseFunctions {
* @param a
* - the value to be evaluated and ignored.
*/
- def ***@***.*** a: Any): Unit = ()
This new behavior is only for 2.13.9. So, if we just remove the
annotation, then for 2.12 and 3 that will cause warnings about unused
function argument.
—
Reply to this email directly, view it on GitHub
<#370 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAXJZDMQVKRHPAS6QIWG73V7775TANCNFSM6AAAAAAQS2RNUU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I agree with this. This approach would require us to do a lot of copy-pasting. Our codebase will lose some maintainability.
It took 9 months for the new release to come. It will be a long run. 🤷🏻♂️ |
My vote is to sit out 2.13.9 for now, this sort of incompatible change in
late stage maintenance release is crazy
…On Sun, 25 Sept 2022, 6:59 pm Daniel Esik, ***@***.***> wrote:
Alternative would be a version specific source file but that's a lot of
bother for such a small issue..
I agree with this. This approach would require us to do a lot of
copy-pasting. Our codebase will lose some maintainability.
Maybe we hold off on 2.13.9 and see if
they reverse it due to popular outcry?
It took 9 months for the new release to come. It will be a long run.
🤷🏻♂️
—
Reply to this email directly, view it on GitHub
<#370 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAXJZGOAXJO7AJYJEB5YMLWAAIADANCNFSM6AAAAAAQS2RNUU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Alternatively, it is possible to implement a version-specific |
... or perhaps another alternative could be leveraging
But it would require to point out all the undesired warning origins in compiler options, of course 🤷 |
Wouldn't that lead to warnings on the user side on using the |
@danicheg I have been poking around the
Bottomline: it seems that it can be made working afterall. See #372 as an example on how it could be addressed. |
...I would also dare to argue that regardless of the changes in v2.13.9 the |
Under
Don't miss the proposal for This proposal from the original ticket was not adopted:
|
I'm reminded that this does not warn because the signature is foreordained:
|
Also from the original proposal for
So the idea was for |
Yeah, I saw that Unfortunately it is not perfect either. Consider this simplified example from import scala.reflect.ClassTag
trait NotNull[A]
class CatchOnlyPartiallyApplied[T](val dummy: Boolean) extends AnyVal {
//def apply[A](f: => A)(implicit CT: ClassTag[T], @deprecated("unused", "now") NT: NotNull[T]): Either[T, A] =
//def apply[A](f: => A)(implicit CT: ClassTag[T], @annotation.nowarn("cat=unused") NT: NotNull[T]): Either[T, A] =
def apply[A](f: => A)(implicit CT: ClassTag[T], NT: NotNull[T]): Either[T, A] =
try {
Right(f)
} catch {
case t if CT.runtimeClass.isInstance(t) =>
Left(t.asInstanceOf[T])
}
} The line without any annotation produces an "unused" warning (apparently)
v2.13.9:
However(!), if we try to utilize
v2.13.9:
Whereas |
It blows my mind, but type ascription really helps to tackle the issue with |
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.
Nice and simple!
Updates org.scala-lang:scala-library from 2.13.8 to 2.13.9.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a
.scala-steward.conf
file.Have a fantastic day writing Scala!
Adjust future updates
Add this to your
.scala-steward.conf
file to ignore future updates of this dependency:Or, add this to slow down future updates of this dependency:
labels: library-update, early-semver-patch, semver-spec-patch, commit-count:n:2