Skip to content

Instantly share code, notes, and snippets.

@lrytz
Created December 12, 2016 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrytz/e10b166ffbed2e47348a7ef8cd072fd9 to your computer and use it in GitHub Desktop.
Save lrytz/e10b166ffbed2e47348a7ef8cd072fd9 to your computer and use it in GitHub Desktop.
case class C(x: Int)
case class D(i: Int*,
)
object Test extends App {
C(1) match {
case C(x @ 1,
) => println(x)
case _ => println(0)
}
def f(x: Int, y: Int*) = y.foldLeft(x)(_+_)
println(f(1,2,
))
println(f(1,List(2, 3): _*))
println(f(1,List(2, 3): _*,
))
import scala.collection.{mutable, immutable,
}
println(mutable.Map(1 -> "one"))
D(1,2,3) match {
case D(1, 2, _ @ _*,
) => println(1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment