We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
package object foo { import scala.collection.generic.FilterMonadic implicit def imp1[A](xs: TraversableOnce[A]) = new { def sfor(f: A => Any) = xs foreach f } implicit def imp2[A, Coll](xs: FilterMonadic[A, Coll]) = new { def fmfor(f: A => Any) = xs foreach f } implicit def imp3[A, CC[X] <: TraversableOnce[X]](xs: CC[A]) = new { def ccfor(f: A => Any) = xs foreach f } } package foo { class A { def f1(xs: Seq[Int]) = xs sfor println // compiles def f2(xs: Int*) = xs sfor println // compiles def f3(xs: Seq[Int]) = xs fmfor println // compiles def f4(xs: Int*) = xs fmfor println // compiles def f5(xs: Seq[Int]) = xs ccfor println // compiles def f6(xs: Int*) = xs ccfor println // fails // ./a.scala:15: error: value ccfor is not a member of Int* // def f6(xs: Int*) = xs ccfor println // fails // ^ // one error found } }
This is not an idle interest, because there are a lot of methods like this:
def f(xs: Foo*) = xs something g
Attempting to move "something" off of Traversable and into an extension method displays bugs like this in stark relief.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-6529?orig=1 Reporter: @paulp
Sorry, something went wrong.
@paulp said: Also, one could reasonably ask why it infers "*" as a type constructor in the first place. Shouldn't this always be Seq?
No branches or pull requests
This is not an idle interest, because there are a lot of methods like this:
Attempting to move "something" off of Traversable and into an extension method displays bugs like this in stark relief.
The text was updated successfully, but these errors were encountered: