-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scaladoc fails to re-substitute macros for inherited members #10823
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
Comments
@Lasering the issue report is really helpful, thanks for raising it and attaching all of the details! I've noticed that, much like the original bug in Scaladoc, this one is a good introduction to compiler internals (and, by extension, Tasty Reflect). The basic problem is that we key expanded docstrings with the symbol they were attached to, but what we should be doing instead is keying them with the symbol they were attached to, and their expansion site. If someone is looking to "get their feet wet" with compiler internals, this issue isn't a bad one to start with. |
I've already solved the problem in Scala2: https://github.com/scala/scala/pull/9060/files. But from your explanation seems the cause is different in Scala3. I can try to solve it. Not sure if its even possible, but this idea of defining variables in the docs could be made to work across jar boundaries? Let me give a more detailed explanation:
|
@Lasering with our approach, what you outlined is indeed possible (or at least I'd be deeply surprised if it wasn't). Scala3doc doesn't create dependencies based on source files, it instead loads .tasty files created by the Scala3 compiler (and published on Maven). This means that from our perspective, there's 0 difference between definitions of the current project, and definitions of other projects. |
Before going further, please check that the problem is reproducible with Scala 3.0.0-M3 and sbt-dotty 0.5.0 since dottydoc was replaced by scala3doc in that release. |
With those versions there are some improvements, but there are still misses:
|
@abgruszecki can you point me to where this is being done? |
This is the entrypoint to "comment cooking": https://github.com/lampepfl/dotty/blob/master/scala3doc/src/dotty/dokka/tasty/comments/CommentExpander.scala#L345 |
Minimized code
build.sbt
Run:
Expectation
The resulting documentation has the same problems as described scala/bug#9785.
The text was updated successfully, but these errors were encountered: