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

Descendant objects reference wrong type for inner classes in Scaladoc #3314

Closed
scabug opened this issue Apr 17, 2010 · 6 comments
Closed

Descendant objects reference wrong type for inner classes in Scaladoc #3314

scabug opened this issue Apr 17, 2010 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Apr 17, 2010

The scaladoc of enumerations only appear as "Value" and in the hover just show scala.Enumeration.Value and not the actual enumeration class. For this to be useful, it needs to show the specific enumeration object.

Examples:

scala.swing.ScrollBar has 'def orientation: Value' and users must guess about which enumeration is required. Should have a link to ScrollBar.Orientation in the docs. Compare this to how JavaDoc provides direct links to the specific enums: http://java.sun.com/javase/6/docs/api/javax/swing/JList.html#setDropMode%28javax.swing.DropMode%29

@scabug
Copy link
Author

scabug commented Apr 17, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3314?orig=1
Reporter: adrianp
See #5211

@scabug
Copy link
Author

scabug commented Feb 24, 2012

Trond Olsen (tolsen77) said (edited on Feb 24, 2012 6:02:11 PM UTC):
An example in the interpreter shows that the compiler generates the correct type for inner classes in the outer object:

scala> :paste
// Entering paste mode (ctrl-D to finish)

class Enum {
  abstract class Value
  class Val extends Value
  def Value(): Value = new Val
}

object Constants extends Enum {
  val a = Value
}

// Exiting paste mode, now interpreting.

defined class Enum
defined module Constants

scala> Constants.a
res23: Constants.Value = Enum$Val@d5454d

While the generated Scaladoc reference the parent class, ignoring the outer object of the inner class:

val a: Enum.Value

@scabug
Copy link
Author

scabug commented Feb 25, 2012

@VladUreche said:
Indeed, type printing in Scaladoc has some missing cases (existentials, enums ...).
I'm willing to help anyone interested in fixing it.

@scabug
Copy link
Author

scabug commented Jul 20, 2012

@adriaanm said:
scala/scala#925

@scabug scabug closed this as completed Jul 20, 2012
@scabug
Copy link
Author

scabug commented Jul 23, 2012

@VladUreche said:
Interesting, how did this get assigned to Adriaan?

@scabug
Copy link
Author

scabug commented Jul 23, 2012

@VladUreche said:
Anyway, now it's fixed in trunk, take BoxPanel's constructor for example.

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