Skip to content

Implicit BuildFrom Not In Scope With Exclusive Range #12105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adamgfraser opened this issue Aug 2, 2020 · 1 comment
Closed

Implicit BuildFrom Not In Scope With Exclusive Range #12105

adamgfraser opened this issue Aug 2, 2020 · 1 comment

Comments

@adamgfraser
Copy link

reproduction steps

Using Scala 2.13.3,

import scala.concurrent._
import scala.concurrent.ExecutionContext.global
  
implicit val ec = global
  
Future.traverse(1 until 10)(a => Future.unit)
// Cannot construct a collection of type scala.collection.immutable.AbstractSeq[Unit] with elements of type Unit based on a collection of type scala.collection.immutable.AbstractSeq[Int].

problem

There is no implicit CanBuildFrom in scope here when the range is exclusive, even though there is when the range is inclusive. I would expect we should be able to build something here, especially when we can in seemingly the same situation if we just do 1 to 10 instead of 1 until 10.

@som-snytt
Copy link

Duplicates #11875 and others. "Fixed in dotty." Workaround is to provide type args or use Range.inclusive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants