Fix warnings in stdlib samples and test modules

This commit is contained in:
Alexander Udalov
2021-07-25 17:23:55 +02:00
parent 0d1380c232
commit 3bc0eaff59
12 changed files with 26 additions and 11 deletions
+2 -1
View File
@@ -463,7 +463,7 @@ class MapTest {
doTest("HashMap", mapLetterToIndex.toMap(HashMap()), "c", 2)
doTest("LinkedHashMap", mapLetterToIndex.toMap(LinkedHashMap()), "d", 3)
val builtMap = buildMap {
buildMap {
putAll(mapLetterToIndex)
doTest("MapBuilder", this, "z", 25)
}
@@ -479,6 +479,7 @@ class MapTest {
assertEquals("Alice", firstAdult)
assertEquals("Alice", firstAdultOrNull)
@Suppress("UNUSED_VARIABLE")
assertFailsWith<NoSuchElementException> { val firstChild = map.firstNotNullOf { (name, age) -> name.takeIf { age <= 11 } } }
val firstChildOrNull = map.firstNotNullOfOrNull { (name, age) -> name.takeIf { age <= 11 } }