diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-15 04:45:47 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-15 04:45:47 +0000 |
commit | f972729b04c44c12ea10d5aa5bb841fc3b40ab69 (patch) | |
tree | 3cbbe97f20b10a5303828324be5b0a9ced00df0c /test | |
parent | 70d4eb9654a2e7a6ba7dad2b62df36793678d99f (diff) | |
download | scala-f972729b04c44c12ea10d5aa5bb841fc3b40ab69.tar.gz scala-f972729b04c44c12ea10d5aa5bb841fc3b40ab69.tar.bz2 scala-f972729b04c44c12ea10d5aa5bb841fc3b40ab69.zip |
Leveraged -Xmigration to burn off some warts wh...
Leveraged -Xmigration to burn off some warts which arose in the new
collections. Warnings put in place for behavioral changes, allowing the
following. 1) Buffers: create new collections on
++ and -- like all the other collections. 2) Maps: eliminated
never-shipped redundant method valuesIterable and supplied these
return types:
def keys: Iterable[A]
def keysIterator: Iterator[A]
def values: Iterable[B]
def valuesIterator: Iterator[B]
def keySet: Set[A]
I concluded that keys should return Iterable because keySet also exists
on Map, and is not solely in the province of Maps even if we wanted to
change it: it's defined on Sorted and also appears in some Sets. So it
seems sensible to have keySet return a Set and keys return the more
general type.
Closes #3089, #3145. Review by odersky.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/migration28.check | 2 | ||||
-rw-r--r-- | test/files/run/t2526.scala | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/test/files/neg/migration28.check b/test/files/neg/migration28.check index 19aba2c31d..4c8c58e0fd 100644 --- a/test/files/neg/migration28.check +++ b/test/files/neg/migration28.check @@ -2,7 +2,7 @@ migration28.scala:5: error: method ++= in class Stack is deprecated: use pushAll s ++= List(1,2,3) ^ migration28.scala:7: error: method foreach in class Stack has changed semantics: - Stack iterator and foreach now traverse in FIFO order. +Stack iterator and foreach now traverse in FIFO order. s foreach (_ => ()) ^ two errors found diff --git a/test/files/run/t2526.scala b/test/files/run/t2526.scala index 5f6d60546a..235aca234d 100644 --- a/test/files/run/t2526.scala +++ b/test/files/run/t2526.scala @@ -20,9 +20,8 @@ object Test { assertForeach(keys, m.keysIterator) assertForeach(keys, m.keySet) - assertForeach(values, m.valuesIterable.iterator) + assertForeach(values, m.values.iterator) assertForeach(values, m.valuesIterator) - assertForeach(values, m.valuesIterable) assertForeach(entries, m) } |