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

Scattered method parameter list with default argument #4588

Closed
scabug opened this issue May 15, 2011 · 5 comments
Closed

Scattered method parameter list with default argument #4588

scabug opened this issue May 15, 2011 · 5 comments
Assignees
Labels

Comments

@scabug
Copy link

@scabug scabug commented May 15, 2011

When using default arguments, the method parameter list includes in the browser lots of new lines thus scattering the output. For instance,

def totalDegree (implicit nodeDegree: DegreeFunction = Degree,
                          degreeFilter: DegreeFilter = AnyDegree): Int

is formatted to

def totalDegree  (implicit nodeDegree: DegreeFunction =
                   Degree
    , degreeFilter: DegreeFilter =
                   AnyDegree
    ): Int  

Imo the default arguments should be on the same line as =...

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 15, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4588?orig=1
Reporter: Sonnenschein (sonnenschein)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 30, 2011

Rüdiger Keller (ruedigerk) said:
This issue is fixed by changing a single rule in the file /scala/tools/nsc/doc/html/resource/lib/template.css.

Change the rule

.signature .symbol

to

.signature > .symbol

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 1, 2011

@paulp said:
r25213.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 16, 2011

Sonnenschein (sonnenschein) said (edited on Aug 16, 2011 11:48:43 AM UTC):
Sorry, but this issue is not resolved in 2.9.1.RC2.
Moreover, default values are sometimes not printed at all. You will find a test below.
Thanks, Peter

Please check for instance:

trait Test {
def even(i: Int) = i % 2 == 0
def max (implicit str : String = "A",
flt: Int => Boolean = even) = 100
}
object Test {
def from[N](nodeStreams: Seq[List[N]] = Seq.empty[List[N]],
nodes: Iterable[N] = Seq.empty[N])
{}
}

// "A" and even are placed on new lines
// default values Seq.empty... are not printed

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 16, 2011

@harrah said:
While I sympathize with the difficulty determining what version contains a given fix, the current practice is to close a bug when fixed in trunk. This fix went into RC3.

The other issue you mentioned has existed since 2.8.1 and should be a separate bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.