Define plusAssign operator for mutable collections.

#KT-4020 Fixed
This commit is contained in:
Ilya Gorbunov
2015-07-08 16:05:25 +03:00
parent dd945f4d1a
commit 2c28c5a8e8
2 changed files with 28 additions and 0 deletions
@@ -233,6 +233,12 @@ class CollectionTest {
l += arrayOf("cheese", "wine")
assertEquals(listOf("cheese", "foo", "beer", "cheese", "wine"), l)
assertTrue(l !== lOriginal)
val ml = arrayListOf("cheese")
ml += "foo"
ml += listOf("beer")
ml += arrayOf("cheese", "wine")
assertEquals(l, ml)
}
test fun requireNoNulls() {