Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
implicitNotFound for BuildFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Jan 26, 2018
1 parent 6d058bd commit 3149572
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down

0 comments on commit 3149572

Please sign in to comment.