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

Enable -Xsource:3 and reduce noise #663

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Sep 28, 2021

Copy link
Collaborator

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@@ -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"),
Copy link
Collaborator

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.

Copy link
Contributor Author

@som-snytt som-snytt Sep 28, 2021

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.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

❤️

@dwijnand dwijnand merged commit 571ed1d into lightbend-labs:main Sep 29, 2021
@SethTisue SethTisue added this to the 1.0.1 milestone Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants