Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Last active December 29, 2015 21:59
Show Gist options
  • Save xuwei-k/7733744 to your computer and use it in GitHub Desktop.
Save xuwei-k/7733744 to your computer and use it in GitHub Desktop.
Scala2.11 awesome!
scalaVersion := "2.11.0"
scalacOptions ++= Seq("-Ywarn-unused", "-Ywarn-unused-import", "-Xlint")
import scala.sys._
object Main{
val a = b + "foo"
val b = "b"
private val c = 0
private var d = 1
println(d)
def hoge(): Unit = {
val x = 0
println("foo $x")
}
}
[warn] Main.scala:14: `$x` looks like an interpolated identifier! Did you forget the interpolator?
[warn] println("foo $x")
[warn] ^
[warn] Main.scala:1: Unused import
[warn] import scala.sys._
[warn] ^
[warn] Main.scala:7: private val in object Main is never used
[warn] private val c = 0
[warn] ^
[warn] Main.scala:8: private setter in object Main is never used
[warn] private var d = 1
[warn] ^
[warn] Main.scala:13: local val in method hoge is never used
[warn] val x = 0
[warn] ^
[warn] Main.scala:4: Reference to uninitialized value b
[warn] val a = b + "foo"
[warn] ^
[warn] 6 warnings found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment