-
Notifications
You must be signed in to change notification settings - Fork 71
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
Enable -Xsource:3 and reduce noise #663
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ inThisBuild(Seq( | |
), | ||
scmInfo := Some(ScmInfo(url("https://github.com/lightbend/mima"), "scm:git:[email protected]:lightbend/mima.git")), | ||
dynverVTagPrefix := false, | ||
scalacOptions := Seq("-feature", "-deprecation", "-Xlint"), | ||
scalacOptions ++= Seq("-feature", "-Xsource:3", "-Xlint", "-Wconf:cat=deprecation&msg=Stream|JavaConverters:s"), | ||
resolvers ++= (if (isStaging) List(stagingResolver) else Nil), | ||
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging), | ||
)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,13 +141,13 @@ object PicklePrinter { | |
/** Returns the buffer as a sequence of (Int, Array[Byte]) representing | ||
* (tag, data) of the individual entries. Saves and restores buffer state. | ||
*/ | ||
private def toIndexedSeq(buf: PickleBuffer): IndexedSeq[(Int, Array[Byte])] = { | ||
private def toIndexedSeq(buf: PickleBuffer): IndexedSeq[(Int, Array[Byte])] = ( | ||
for (idx <- buf.createIndex) yield { | ||
buf.atIndex(idx) { | ||
val tag = buf.readByte() | ||
val len = buf.readNat() | ||
tag -> buf.bytes.slice(buf.readIndex, buf.readIndex + len) | ||
} | ||
} | ||
} | ||
).toIndexedSeq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's going on here? Looks like there's an implicit conversion from Array to immutable IndexedSeq?? Wow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is obvious in some contexts but not this one. There is not a good "just wrap my array" solution that cross-compiles. I was about to tweak the loop to iterate once over buf to build an IndexedSeq but maybe that is overkill, and more of just an exercise one does at midnight when time seems momentarily infinite. |
||
} |
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.
Does that deprecation warning keep the rest of the deprecations showing? Intuitively I would have thought there should be an "enable deprecations" option in addition to the "oh and silence these ones", which has me confused.
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.
-Xlint enables deprecation, and that was backported to 2.12 as well (as I did check).
Edit: you remind me that Scala 3 doesn't have -Xlint yet. I was about to restore the deprecation flag but spouse complained that I was coding at midnight and I hit PR button.