Skip to content
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

Method "flatten" does not show up #5373

Closed
scabug opened this issue Jan 13, 2012 · 9 comments
Closed

Method "flatten" does not show up #5373

scabug opened this issue Jan 13, 2012 · 9 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jan 13, 2012

I have no idea what is triggering this, but the method "flatten" is not being displayed on collections. Whether there are other methods that are missing or not I don't know.

@scabug
Copy link
Author

scabug commented Jan 13, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5373?orig=1
Reporter: @dcsobral
Affected Versions: 2.10.0
Attachments:

  • missing.txt (created on Mar 26, 2012 3:32:52 PM UTC, 143972 bytes)

@scabug
Copy link
Author

scabug commented Jan 13, 2012

@paulp said:
Probably because flatten isn't a method on the collections. There's a bridge method there for some reason, but other than that it comes via an implicit conversion in the companion object. There's some good reason for this which I forget.

@scabug
Copy link
Author

scabug commented Jan 13, 2012

@dcsobral said:
What is this doing in GenericTraversableTemplate then?

  def flatten[B](implicit asTraversable: A => /*<:<!!!*/ GenTraversableOnce[B]): CC[B] = {                      
    val b = genericBuilder[B]                                                                                   
    for (xs <- sequential)                                                                                      
      b ++= asTraversable(xs).seq                                                                               
    b.result                                                                                                    
  }   

The method does show up looking the ScalaDoc for it too, but if I click on List in the list of subclasses and search again, it has disappeared.

And it does show up on 2.9.1, where scaladoc hasn't gone through the use case changes.

@scabug
Copy link
Author

scabug commented Jan 13, 2012

@paulp said:
I got suckered there by a) the fact that flatten used to be external and b) the comment at the top of GenericTraversableTemplate says

A template class for companion objects of ``regular`` collection classes

You'd think I'd know better than to believe documentation (not to mention it should be hard for me to forget what GenericTraversableTemplate does) but some days are like that.

@scabug
Copy link
Author

scabug commented Mar 26, 2012

@VladUreche said:
Okay, here's the explanation why it doesn't appear: The function is defined in GenericTraversableTemplate and redefined with @bridge in Traversable. In scala.collection.immutable.List's linearization, Traversable comes before GenericTraversableTemplate, thus making the method flatten symbol bridge-annotated and filtered out by Scaladoc.

One idea on how to fix that is to filter out @bridge methods ONLY if there are other methods with the same name in the template. What do you think of that?

@scabug
Copy link
Author

scabug commented Mar 26, 2012

@VladUreche said:
I attached a log that shows the functions that were disappearing because they were overridden by @bridge methods. I will only filter the bridge methods that don't override normal methods.

@scabug
Copy link
Author

scabug commented Mar 26, 2012

@VladUreche said:
Functions that were incorrectly filtered out.

@scabug
Copy link
Author

scabug commented Apr 29, 2012

@VladUreche said:
Fixed in d078b589.

@scabug
Copy link
Author

scabug commented Apr 29, 2012

@scabug scabug closed this as completed Jul 23, 2012
@scabug scabug added this to the 2.10.0-M2 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants