My ide tells me about unused local variables, but it's important to remember that scala defaults to public accessibility, so those "unused" methods are actually part of your public api.
I was hoping something had got put behind -Xlint, but this is a case where Xlint wouldn't have told you that.
I forgot to shift my magic number by my very private lucky factor, but got no unused warning under -Xlint -Ywarn-all.
Maybe -Ywarn-all means, "why warn at all?"
If it's any consolation, under -optimise, it won't optimise anything away, either.
object Foo {
// not a compile-time constant, because it used to be 8 every other Tuesday, but I took that out
// because I wasn't sure it was helping.
private [this] final val futz: Int = 7
}
On Mon, Sep 10, 2012 at 1:15 PM, phkoester <beebl...@googlemail.com> wrote:
No, that's not what IDEs are for. Warnings are to be issued by the compiler, dude.
I'm an Eclipse die-hard, don't know much about IntelliJ. But on the console I use Maven, and that's where I want to see the warnings. Ideally both in the IDE and on the console, but it's the console that matters in the end.
On Mon, Sep 10, 2012 at 10:48 PM, Som Snytt <som....@gmail.com> wrote:
object Foo {
// not a compile-time constant, because it used to be 8 every other Tuesday, but I took that out
// because I wasn't sure it was helping.
private [this] final val futz: Int = 7
}Leave out the type ascription and it will be a constant.