Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: Scala 2.10.0-M2
    • Component/s: Scaladoc Tool
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Paul Phillips added a comment -

        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.

        Show
        Paul Phillips added a comment - 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.
        Hide
        Daniel Sobral added a comment -

        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.

        Show
        Daniel Sobral added a comment - 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.
        Hide
        Paul Phillips added a comment -

        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.

        Show
        Paul Phillips added a comment - 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.
        Hide
        Vlad Ureche added a comment -

        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?

        Show
        Vlad Ureche added a comment - 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?
        Hide
        Vlad Ureche added a comment -

        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.

        Show
        Vlad Ureche added a comment - 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.
        Hide
        Vlad Ureche added a comment -

        Functions that were incorrectly filtered out.

        Show
        Vlad Ureche added a comment - Functions that were incorrectly filtered out.
        Hide
        Vlad Ureche added a comment -

        Fixed in d078b589.

        Show
        Vlad Ureche added a comment - Fixed in d078b589 .
        Show
        Vlad Ureche added a comment - Should be filtered earlier: https://groups.google.com/forum/?hl=en&fromgroups#!topic/scala-internals/kHNbXKoUj28

          People

          • Assignee:
            Vlad Ureche
            Reporter:
            Daniel Sobral
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development