From 1aacda21e067e7a019798033b204c5db551836e7 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Sun, 18 Oct 2020 17:06:58 +0900 Subject: [PATCH 1/2] Fix #12065 by adding scaladocs --- src/library/scala/collection/Factory.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/library/scala/collection/Factory.scala b/src/library/scala/collection/Factory.scala index e448ce7524c..43f3746d08f 100644 --- a/src/library/scala/collection/Factory.scala +++ b/src/library/scala/collection/Factory.scala @@ -383,14 +383,29 @@ trait SpecificIterableFactory[-A, +C] extends Factory[A, C] { */ trait MapFactory[+CC[_, _]] extends Serializable { + /** + * An empty Map + */ def empty[K, V]: CC[K, V] + /** + * A collection of type Map generated from given iterable object. + */ def from[K, V](it: IterableOnce[(K, V)]): CC[K, V] + /** + * A collection of type Map that contains given key/value bindings. + */ def apply[K, V](elems: (K, V)*): CC[K, V] = from(elems) + /** + * The default builder for Map objects. + */ def newBuilder[K, V]: Builder[(K, V), CC[K, V]] + /** + * Converts this to a Factory. + */ implicit def mapFactory[K, V]: Factory[(K, V), CC[K, V]] = MapFactory.toFactory(this) } From fff2b81b0c7fc1ce3616ba4c3c2308008bfe5672 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 19 Oct 2020 22:30:02 +0900 Subject: [PATCH 2/2] Update a comment as suggested --- src/library/scala/collection/Factory.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/scala/collection/Factory.scala b/src/library/scala/collection/Factory.scala index 43f3746d08f..72a35f78040 100644 --- a/src/library/scala/collection/Factory.scala +++ b/src/library/scala/collection/Factory.scala @@ -404,7 +404,7 @@ trait MapFactory[+CC[_, _]] extends Serializable { def newBuilder[K, V]: Builder[(K, V), CC[K, V]] /** - * Converts this to a Factory. + * The default Factory instance for maps. */ implicit def mapFactory[K, V]: Factory[(K, V), CC[K, V]] = MapFactory.toFactory(this) }