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

track comptime types #2133

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

track comptime types #2133

wants to merge 3 commits into from

Conversation

mfield
Copy link

@mfield mfield commented Jan 4, 2025

Adds some tracking of comptime types.

changes formatting for comptime structs, e.g. HashMap(...) -> HashMap(i32,void). maybe just a preference of mine? but i like seeing it. could easily change the formatter back to ....

fixes:

@mfield
Copy link
Author

mfield commented Jan 7, 2025

sorry for the false start. saw something while reading the diff and made a small change last second without re-building :(
new version is passing tests again!

Copy link
Member

@Techatrix Techatrix left a comment

Choose a reason for hiding this comment

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

The analysis backend has an existing mechanism to resolve comptime function type parameters. See bound_type_params. I would have expected this field to be replaced instead of adding another solution on top of it. Removing bound_type_params will make most of the existing test fail that deal with generic functions which indicates that this PR is failing to handle them.

Also, have you tried to adding the extra properties of BoundScope to ScopeWithHandle instead of adding .bound_scope to Type.Data? If you need to wrap a container with a bound scope, just create a copy of the existing container with extra bound scopes. I tried to test this change myself but could not quite get it to work so there may be a good reason to keep it this way.

I will hold of with additional review comments until the fundamentals are in a good shape. The idea of keeping a stack of bound parameter types is also what I had in mind when thinking about how to resolve #1392.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants