@@ -5,9 +5,9 @@ import java.lang.String
55import scala .{Int , Unit , Array , Option , StringContext , Boolean , Any , Char }
66import scala .Predef .{println , charWrapper }
77
8- import collection .immutable . _
9- import collection .mutable . _
10- import collection .{ Seq , View , _ }
8+ import collection ._
9+ import collection .immutable .{ List , Nil , LazyList }
10+ import collection .mutable .{ ArrayBuffer , ListBuffer }
1111import org .junit .Test
1212
1313class StrawmanTest {
@@ -289,15 +289,13 @@ class StrawmanTest {
289289 println(xs17.to(List ))
290290 }
291291
292- def sortedSets (xs : strawman.collection. immutable.SortedSet [Int ]): Unit = {
292+ def sortedSets (xs : immutable.SortedSet [Int ]): Unit = {
293293 val xs1 = xs.map((x : Int ) => x.toString)
294- val xs2 : SortedSet [String ] = xs1
295- val xs3 : strawman.collection.immutable.Set [String ] = xs.map((x : Int ) => x.toString)
294+ val xs2 : immutable.SortedSet [String ] = xs1
296295 }
297296
298- def mapOps (xs : strawman.collection. Map [Int , String ]): Unit = {
297+ def mapOps (xs : Map [Int , String ]): Unit = {
299298 val xs1 = xs.map((k, v) => (v, k))
300- // val xs1Bis = xs.map { case (k, v) => (v, k) } Does not compile :(
301299 val xs2 : strawman.collection.Map [String , Int ] = xs1
302300 val xs3 = xs.map(kv => (kv._2, kv._1))
303301 val xs4 : strawman.collection.Iterable [(String , Int )] = xs3
@@ -307,19 +305,19 @@ class StrawmanTest {
307305 println(xs4)
308306 }
309307
310- def sortedMaps (xs : collection. immutable.SortedMap [String , Int ]): Unit = {
308+ def sortedMaps (xs : immutable.SortedMap [String , Int ]): Unit = {
311309 val x1 = xs.get(" foo" )
312310 val x2 : Option [Int ] = x1
313311 val xs1 = xs + (" foo" , 1 )
314- val xs2 : SortedMap [String , Int ] = xs1
312+ val xs2 : immutable. SortedMap [String , Int ] = xs1
315313 val xs3 = xs.map(kv => kv._1)
316- val xs4 : collection. immutable.Iterable [String ] = xs3
314+ val xs4 : immutable.Iterable [String ] = xs3
317315 val xs5 = xs.map((k : String , v : Int ) => (v, k))
318- val xs6 : collection. immutable.SortedMap [Int , String ] = xs5
316+ val xs6 : immutable.SortedMap [Int , String ] = xs5
319317 class Foo
320318// val xs7 = xs.map((k: String, v: Int) => (new Foo, v)) Error: No implicit Ordering defined for Foo
321- val xs7 = (xs : collection. immutable.Map [String , Int ]).map((k, v) => (new Foo , v))
322- val xs8 : collection. immutable.Map [Foo , Int ] = xs7
319+ val xs7 = (xs : immutable.Map [String , Int ]).map((k, v) => (new Foo , v))
320+ val xs8 : immutable.Map [Foo , Int ] = xs7
323321 }
324322
325323 @ Test
0 commit comments