2.10.0-M6: spurious SCOPE_EXIT warnings #6191
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6191?orig=1 |
@SethTisue said: |
Jeff Olson (jdolson) said: import java.util.concurrent.ExecutorService
import java.util.Queue
class Spinner[-T](f: T => Unit, execService: ExecutorService, queue: Queue[T]) {
@volatile private[this] var runFlag = true
def start() {
execService.execute(new Runnable() {
def run() {
while (runFlag) {
val item = queue.poll()
if (item != null) {
try {
f(item)
}
catch {
case t: Throwable => t.printStackTrace()
}
}
}
}
})
}
} Running scalac [Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29)] gives the following: test.scala:12: warning: Visited SCOPE_EXIT before visiting corresponding SCOPE_ENTER. SI-6049
if (item != null) {
^
one warning found |
Lars Hupel (larsrh) said: |
@nilskp said: |
@magarciaEPFL said: |
@som-snytt said: ...jvm/GenASM.scala:133: warning: Visited SCOPE_EXIT before visiting... I agree that the warning is a distraction. Shouldn't it sit behind -Xdev? |
@retronym said: |
@som-snytt said: That might be more useful, on the theory that if a dev sees the SCOPE_EXIT enough to be annoyed, they might be motivated to remedy it. |
@JamesIry said: |
@adriaanm said: |
@SethTisue said: |
@adriaanm said: |
@SethTisue said: |
@adriaanm said: |
fixed by new back end in 2.12 |
this is a less severe form of #6049. #6049 was closed because the back end no longer crashes, but there are still spurious warnings.
so e.g. borrowing Miguel's minimized code from #6049:
at #6049 Miguel said this warning could also be a sign of issues with "whether the debugger shows the variable in question"
The text was updated successfully, but these errors were encountered: