Scala Programming Language
  1. Scala Programming Language
  2. SI-5077

Scaladoc shows an empty parameter list on methods that have no parameter lists

    Details

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

      Description

      In both the 2.9.1 and the current nightly API doc, methods like toString and ## that have zero parameter lists are shown as having a single, empty parameter list. That's incorrect; these are distinct method types.

      For example toString is shown as: def toString (): String when it should be simply def toString: String.

        Activity

        Hide
        Paul Phillips added a comment -

        Actually scaladoc is correct. You are probably getting this idea from the Any.scala source code, which is fiction. The methods are created synthetically, and they do have parens. It's Any.scala that needs adjustment.

        Show
        Paul Phillips added a comment - Actually scaladoc is correct. You are probably getting this idea from the Any.scala source code, which is fiction. The methods are created synthetically, and they do have parens. It's Any.scala that needs adjustment.
        Hide
        Seth Tisue added a comment -

        doh.

        well, I'm tempted to suggest the empty parameter lists be removed from the synthetic methods. it seems like the right thing from the user's perspective. but I can easily imagine it wouldn't really be worth tinkering with.

        I could put the patch to Any.scala and AnyRef.scala together if you like. I'm in there anyway, documenting.

        Show
        Seth Tisue added a comment - doh. well, I'm tempted to suggest the empty parameter lists be removed from the synthetic methods. it seems like the right thing from the user's perspective. but I can easily imagine it wouldn't really be worth tinkering with. I could put the patch to Any.scala and AnyRef.scala together if you like. I'm in there anyway, documenting.
        Hide
        Commit Message Bot added a comment -

        (extempore in r25836) Donated some parens to Any.

        And a touch of documentation correctness. Closes SI-5077, no review.

        Show
        Commit Message Bot added a comment - (extempore in r25836 ) Donated some parens to Any. And a touch of documentation correctness. Closes SI-5077 , no review.
        Hide
        Paul Phillips added a comment -

        Can't even begin to imagine the breakage that would cause. Every call of the form "x.toString()" where x is an Any would become a compile error.

        Show
        Paul Phillips added a comment - Can't even begin to imagine the breakage that would cause. Every call of the form "x.toString()" where x is an Any would become a compile error.
        Hide
        Seth Tisue added a comment -

        I am a bear of very little brain today.

        Show
        Seth Tisue added a comment - I am a bear of very little brain today.
        Hide
        Seth Tisue added a comment -

        AnyRef.scala needs the same adjustment. pull request: https://github.com/scala/scala/pull/105

        Show
        Seth Tisue added a comment - AnyRef.scala needs the same adjustment. pull request: https://github.com/scala/scala/pull/105

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Seth Tisue
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development