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
Bad return type for [Use Case] docs in Range #5678
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5678?orig=1 |
@dcsobral said: |
fabien sartor (fasar) said: # scala -version
Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL In scala API doc at Range page there is an use case of union (http://www.scala-lang.org/api/current/scala/collection/immutable/Range.html) def union(that: Seq[Int]): Range[A] Then when I use union, Range union produces IndexedSeq. scala> Range(1,5).union(Range(4,8))
res0: scala.collection.immutable.IndexedSeq[Int] = Vector(1, 2, 3, 4, 4, 5, 6, 7)
Range(1,5).union(Seq(4,3,2))
res1: scala.collection.immutable.IndexedSeq[Int] = Vector(1, 2, 3, 4, 4, 3, 2) The doc explains : def union[B >: Int, That](that: GenSeq[B])(implicit bf: CanBuildFrom[IndexedSeq[Int], B, That]): That But it's more difficult to read and possibly not corroborating with the usecase. |
@dcsobral said: Anyway, I have looked into it, and verified that there's no CanBuildFrom that creates a Range. Furthermore, it seems It's a very small change, but one does have to build the docs to look them over, and I'm a bit out of time these days. Maybe someone will come and pick this up, but this sort of ticket is very low priority. If you had more experience with Scala, I'd advise to look into submitting a pull request for it yourself. And if you have enough git, github and ant experience, you should try it -- just remove the line where |
@adriaanm said: |
Many [Use case] entries in the documentation of Range report Range as return type when it should be IndexedSeq (or Seq[...]).
The text was updated successfully, but these errors were encountered: