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

implicitNotFound for BuildFrom #373

Merged
merged 1 commit into from
Jan 29, 2018
Merged

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Jan 26, 2018

scala> class Lst[+A] {
     |   def map[B, That](f: A => B)(implicit bf: strawman.collection.BuildFrom[Lst[A], B, That]): That = scala.Predef.???
     | }
defined class Lst

scala> object Test {
     |   def foo(l: Lst[scala.Int]) = l.map[scala.Int, Lst[scala.Predef.String]](x => 1)
     | }
         def foo(l: Lst[scala.Int]) = l.map[scala.Int, Lst[scala.Predef.String]](x => 1)
                                                                                ^
On line 2: error: Cannot construct a collection of type Lst[String] with elements of type Int based on a collection of type Lst[Int].

This is an existing test case in scala/scala: https://github.com/scala/scala/blob/2.13.x/test/files/neg/t2462a.check

@lrytz lrytz requested a review from julienrf January 26, 2018 11:09
@julienrf julienrf merged commit 0767dbe into scala:master Jan 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants