-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to document the API of compiler intrinsic definitions #10899
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
EDIT: the comparison of the two approaches is that in the first, we always have deftrees for every symbol we document, which is more in line with how the doctool thinks; the second approach might have applications beyond documenting stdlib symbols - for instance, one may load multiple libraries to document and add custom docstrings to symbols not originally documented. Now that I think about it, perhaps we could actually expose functionality for attaching docstrings to symbols on Reflect level? Could be useful, and is feasible given that docstrings are kept in a mutable hashmap. |
or add the docstrings to the symbols when we create them in Definitions.scala, that way |
The solution proposed by smarter seems to be the most reasonable. |
After a little research I see few options: Reusing files from library-auxWe could try compiling these classes to get TASTY files and attach it to the doctool run. However, it is impossible right now; dotty prevents shadowing
Cons:
At last we could do some file processing (change package for sake of not conflicting with fq names, remove New docstringsWe can either:
Pros:
Cons:
@smarter do you have any opinions what solution fits the best? |
Embedding them in the code still looks like the best solution to me here. |
there are several standard library public definitions that do not appear in http://dotty.epfl.ch/api/index.html because they are generated on the fly by the compiler and so do not have a definition in tasty files
Magic in Scala 2/3
the following appear in https://www.scala-lang.org/api/2.13.4/index.html:
scala.Nothing
scala.AnyVal
scala.Any
scala.Singleton
scala.Null
Magic in Scala 3
scala.AnyKind
scala.Matchable
scala.&
scala.|
Miscellaneous
(Edit: yes I see now that the root is just theroot
packageAPI
page but just not labelled as root)The text was updated successfully, but these errors were encountered: