From cc9c1b7e53213830f5a6304504470068b52d40b4 Mon Sep 17 00:00:00 2001 From: Narayanan Date: Tue, 27 Aug 2019 10:02:54 +0530 Subject: [PATCH] Update Maps.scala scala> myMap - ("MI", "IA") ^ warning: method - in trait MapOps is deprecated (since 2.13.0): Use -- with an explicit collection res1: scala.collection.immutable.Map[String,String] = Map(OH -> Ohio, WI -> Wisconsin) --- src/main/scala/stdlib/Maps.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/stdlib/Maps.scala b/src/main/scala/stdlib/Maps.scala index db3cac53..44931892 100644 --- a/src/main/scala/stdlib/Maps.scala +++ b/src/main/scala/stdlib/Maps.scala @@ -127,11 +127,12 @@ object Maps extends FlatSpec with Matchers with org.scalaexercises.definitions.S } /** Map elements can be removed with a tuple: + * '-' Operator is deprecated on MapOps from scala 2.13.0 */ def removedWithTupleMaps(res0: Boolean, res1: Boolean, res2: Boolean, res3: Int, res4: Int) { val myMap = Map("MI" → "Michigan", "OH" → "Ohio", "WI" → "Wisconsin", "IA" → "Iowa") - val aNewMap = myMap - ("MI", "WI") // Notice: single '-' operator for tuples + val aNewMap = myMap - ("MI", "WI") // Notice: single '-' operator for tuples; works, but deprecated starting scala 2.13.0 aNewMap.contains("MI") should be(res0) myMap.contains("MI") should be(res1)