From 7e933d5b5a4c1c8795b74e67e2148c6fc4ca19a6 Mon Sep 17 00:00:00 2001 From: Stefan Zeiger Date: Wed, 6 Jul 2016 19:42:57 +0200 Subject: SI-6947 Better type parameter names for Map classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Type parameter names are currently assigned pretty much alphabetically without any meaning. This change renames all key parameters in Map classes from `A` to `K` and all value parameters from `B` to `V` to make them more meaningful. Derived names are renamed accordingly (e.g. `V1` instead of `B1` for an upper bound on `V`, `W` instead of `C` for a new value type). As a side-effect this solves the documentation problem in SI-6947. Due to using `B` both as a type parameter for `foldLeft[B]` in `GenTraversableOnce[A]` and in `Map[A, B]` which extends `GenTraversableOnce[(A, B)]`, the signature of `Map.foldLeft` was rendered in scaladoc as def foldLeft[B](z: B)(op: (B, (A, B)) ⇒ B): B Now you get an unambiguous version: def foldLeft[B](z: B)(op: (B, (K, V)) ⇒ B): B --- test/files/run/xMigration.check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/files') diff --git a/test/files/run/xMigration.check b/test/files/run/xMigration.check index cd860bf394..1104dbea83 100644 --- a/test/files/run/xMigration.check +++ b/test/files/run/xMigration.check @@ -11,7 +11,7 @@ scala> :setting -Xmigration:any scala> Map(1 -> "eis").values // warn :12: warning: method values in trait MapLike has changed semantics in version 2.8.0: -`values` returns `Iterable[B]` rather than `Iterator[B]`. +`values` returns `Iterable[V]` rather than `Iterator[V]`. Map(1 -> "eis").values // warn ^ res2: Iterable[String] = MapLike(eis) @@ -25,7 +25,7 @@ scala> :setting -Xmigration:2.7 scala> Map(1 -> "eis").values // warn :12: warning: method values in trait MapLike has changed semantics in version 2.8.0: -`values` returns `Iterable[B]` rather than `Iterator[B]`. +`values` returns `Iterable[V]` rather than `Iterator[V]`. Map(1 -> "eis").values // warn ^ res4: Iterable[String] = MapLike(eis) @@ -39,7 +39,7 @@ scala> :setting -Xmigration // same as :any scala> Map(1 -> "eis").values // warn :12: warning: method values in trait MapLike has changed semantics in version 2.8.0: -`values` returns `Iterable[B]` rather than `Iterator[B]`. +`values` returns `Iterable[V]` rather than `Iterator[V]`. Map(1 -> "eis").values // warn ^ res6: Iterable[String] = MapLike(eis) -- cgit v1.2.3