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

TC: Attach type information to nodes #496

Merged
merged 6 commits into from Aug 24, 2022
Merged

Conversation

kontheocharis
Copy link
Collaborator

This PR adds a store NodeInfoStore which maps AstNodeIds to TermIds and PatIds. It is a necessary step for implementing mono/lowering to IR, as well as any post-TC semantic stages.

Closes #240.

@kontheocharis kontheocharis added type-system Issues related with typechecking sub-system. ast Relating to AST labels Aug 23, 2022
@kontheocharis kontheocharis self-assigned this Aug 23, 2022
Copy link
Contributor

@feds01 feds01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have a bunch of the test cases changed?

@feds01
Copy link
Contributor

feds01 commented Aug 23, 2022

Also, the entries that map AstNodeId need to be added when traversing.

And, the tc state needs to be somehow externally accessible, which means all the tc data structures need to be public or in their own crate?

@kontheocharis
Copy link
Collaborator Author

And, the tc state needs to be somehow externally accessible, which means all the tc data structures need to be public or in their own crate?

@feds01 Yeah, I guess that is the next step once these entries will actually be used. However, I think that whichever crate needs them should probably just depend on TC. So they could just stay where they are in global storage for now..

@feds01
Copy link
Contributor

feds01 commented Aug 23, 2022

Since the hash-lowering crate is dependent on all of this information, I guess this will mean it is dependent on GlobalStorage? Which means it has to be exposed to the lowering stage and to the pipeline.

@kontheocharis
Copy link
Collaborator Author

Yeah lowering should definitely depend on TC, because that is the utility it uses to actually know what to lower it to... I guess we can split TC impl from TC primitives into different crates but that might not bring so many advantages.

@kontheocharis kontheocharis merged commit 6e4a3bc into main Aug 24, 2022
@kontheocharis kontheocharis deleted the tc-attach-to-nodes branch August 24, 2022 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Relating to AST type-system Issues related with typechecking sub-system.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

LM: AST traversal to typecheck and add types to nodes
2 participants