From 314957263cc028e6738df7830bdab791273daf42 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Fri, 26 Jan 2018 12:03:45 +0100 Subject: [PATCH] implicitNotFound for BuildFrom --- collections/src/main/scala/strawman/collection/BuildFrom.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/collections/src/main/scala/strawman/collection/BuildFrom.scala b/collections/src/main/scala/strawman/collection/BuildFrom.scala index 48390ea2e2..c3b55b6785 100644 --- a/collections/src/main/scala/strawman/collection/BuildFrom.scala +++ b/collections/src/main/scala/strawman/collection/BuildFrom.scala @@ -3,6 +3,7 @@ package strawman.collection import scala.{Any, Ordering, deprecated, `inline`} import strawman.collection.mutable.Builder +import scala.annotation.implicitNotFound /** Builds a collection of type `C` from elements of type `A` when a source collection of type `From` is available. * Implicit instances of `BuildFrom` are available for all collection types. @@ -11,6 +12,7 @@ import strawman.collection.mutable.Builder * @tparam A Type of elements (e.g. `Int`, `Boolean`, etc.) * @tparam C Type of collection (e.g. `List[Int]`, `TreeMap[Int, String]`, etc.) */ +@implicitNotFound(msg = "Cannot construct a collection of type ${C} with elements of type ${A} based on a collection of type ${From}.") trait BuildFrom[-From, -A, +C] extends Any { def fromSpecificIterable(from: From)(it: Iterable[A]): C