aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/collections.scala
blob: e91a90a907004a1908dae62d79a57e095d1a6d33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import scala.collection.generic.CanBuildFrom

object collections {
  
  val cbf: CanBuildFrom[List, Int, List[Int]] = scala.collection.immutable.List.canBuildFrom

  val nil = Nil
  val ints1 = 1 :: Nil
  val ints2 = 1 :: 2 :: Nil
  val ints3: List[Int] = ints2
  val f = (x: Int) => x + 1
  val ints4: List[Int] = List(1, 2, 3, 5)
    
  val ys = ints3 map (x => x + 1)
  val zs = ys filter (y => y != 0)

}