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

Documentation needs access to original type definition for type aliases #745

Open
SeanTAllen opened this issue Apr 13, 2016 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Comments

@SeanTAllen
Copy link
Member

By time the doc generation run ends, we have a type checked AST. This is awesome because it's easy to know for any name, what package etc it is in and allows for easy cross linkage in documentation. However, for type aliases instead of putting the alias like:

Compare

we instead get

(Less | Equal | Greater)

which is the fully type checked version of

type Compare is (Less | Equal | Greater)

It would enhance the documentation if we had a full type checked AST but access still to the original type alias (so we could use it instead and easily link to it).

@jemc
Copy link
Member

jemc commented Apr 14, 2016

The idea I proposed in our discussion for solving this one - refactoring the compiler AST to represent the type as a list of types (instead of a single type). The first item in the list would be the nominal type given in the source code, if any; the last item in the list would be the fully resolved type (up to the latest pass run by the compiler so far); the items in between would be the various stages of resolution between these two points, if any. This way, we never "throw away" an earlier resolution of a type as we continue to resolve.

I think it seems appropriate, but we may find otherwise when we go to implement it.

@SeanTAllen SeanTAllen added enhancement New feature or request help wanted Extra attention is needed documentation Improvements or additions to documentation and removed enhancement: 2 - under discussion labels May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants