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

Scaladoc is years before the language and creates opaque objects #21228

Closed
KacperFKorban opened this issue Jul 19, 2024 · 4 comments · Fixed by #21640
Closed

Scaladoc is years before the language and creates opaque objects #21228

KacperFKorban opened this issue Jul 19, 2024 · 4 comments · Fixed by #21640
Labels
area:doctool itype:bug Spree Suitable for a future Spree
Milestone

Comments

@KacperFKorban
Copy link
Member

Compiler version

3.6.0-RC1-bin-20240718-bd84584-NIGHTLY, 3.4.2

Minimized code

//> using scala 3.nightly
// opaqueobject.scala

object Sth:
  opaque type A = Int

scala-cli doc opaqueobject.scala

Output

The object documentation also gets an opaque modifier.
The opaque type is documented correctly.

opaque object documentation

Expectation

The object documentation doesn't have an opaque modifier

@odersky
Copy link
Contributor

odersky commented Jul 23, 2024

It's not really opaque types. The compiler uses internally opaque as a flag for the object or class containing an opaque type. That won't change. It should be the job of the scaladoc to filter that out.

@SethTisue SethTisue added the Spree Suitable for a future Spree label Aug 7, 2024
@mbovel
Copy link
Member

mbovel commented Sep 23, 2024

We could probably filter out opaque in parseObject?

def parseObject(classDef: ClassDef, signatureOnly: Boolean = false): Member =
mkClass(classDef)(
// All objects are final so we do not need final modifier!
modifiers = classDef.symbol.getExtraModifiers().filter(_ != Modifier.Final),
signatureOnly = signatureOnly
)

Or could we directly remove opaque from def getExtraModifiers()?

cc @Florian3k

@KacperFKorban
Copy link
Member Author

KacperFKorban commented Sep 23, 2024

@mbovel Yes, it seems like the correct solution. (I meant the one in parseObject 😅)

@Florian3k
Copy link
Contributor

Filtering should be fine. Not so sure about removing it from getExtraModifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:doctool itype:bug Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants