-Xlint:captured to warn on *Ref boxing#8691
Conversation
Maybe we need an -Xslow instead, for stuff that does what you expect but maybe not quite as fast. It's a testament either to the power of scalac's warning capability or of the simplicity of this feature that it's implemented in only around 5 lines of code.
| @@ -0,0 +1 @@ | |||
| -Xfatal-warnings -Xlint:captured No newline at end of file | |||
There was a problem hiding this comment.
Should be // scalac: -Werrror etc in the test source.
Wait, you know this, what year is this?
Is this that thing where you PR against an old branch and you never know what features are supported?
There was a problem hiding this comment.
It's the thing where I'm on my phone hotspot and Seth just upgraded sbt so I can't switch to 2.13.x, and I didn't really want to go poking around in git to see what the latest 2.13.x commit I can build on is, and moreover I do know this because I keep telling myself I'll backport it to the scala-partest repo and bribe a kind Lightbender to release a new partest, or I could just not bother.
I get this from you every time, btw.
Do we even want this in 2.12? @mkeskells might, or @diesalbla.
There was a problem hiding this comment.
-Werrror should be the variant that deletes the source file because it emitted a warning.
|
This seems like a somewhat drastic lint warning IMO. Maybe its nice to have it available, but I feel like this would make plenty of folks using If you have a benchmark that simulates the application usage, its pretty easy to find the worthwhile places to avoid such captures by looking for the allocation stack traces of the |
|
Is it almost on a par with Can anyone enable Not all |
|
Maybe |
|
I think this has hit a |
|
agree this more properly would be part of a separate linter or Scalafix ruleset |
|
As hrhino pointed out, it's one LOC here. It was Ichoran who pointed out once how pernicious it is when you rewrite your while loop and accidentally ruin performance. I don't really want to look at stack traces while I'm refactoring. I agree it's maybe noisy for |
Maybe we need an -Xslow instead, for stuff that does what you expect but maybe not quite as fast. It's a testament either to the power of scalac's warning capability or of the simplicity of this feature that it's implemented in only around 5 lines of code.