-
Notifications
You must be signed in to change notification settings - Fork 57
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 Typelevel scalac options #458
Conversation
statsScope.scope("clock").gauge("skew")((System.currentTimeMillis() - millis).toDouble) | ||
locally { | ||
val _ = | ||
statsScope.scope("clock").gauge("skew")((System.currentTimeMillis() - millis).toDouble) |
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 couldn't use the @unused
annotation because it isn't available in Scala 2.12. You are supposed to be able to annotate with : Unit
to avoid discarded non-unit value warnings but I have very little success using that approach. Perhaps UnsafeGuage
should have a void
method or there should be another gauge
method that returns 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.
Metrics are held via weak references in kyo-stats-registry
so we need the class field holding the gauge
reference to avoid it getting garbage collected. Maybe we could move kyo.discard
to kyo-scheduler
?
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 moved discard
to kyo-scheduler
but it is using Scala 3 top level function definitions and so isn't going to work. I'll have to come up with something else.
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.
Ok scratch that. You already removed the -Wunused:all
option so this is now a non-issue.
Scrapping this in favor of #485 |
I was working on #390 which adds a few different projects for the code gen and configuring the different options for the different scala versions was a pain. This makes it a fair bit easier and removes some of the existing workarounds.
I didn't go as far as adding https://github.com/typelevel/sbt-tpolecat although that would be my preference.
I "fixed" (ignored) a few warnings which possibly started showing up as I didn't remove as many warnings for the projects with Scala 2.12.
There are still 2 left: