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

Add Inspect to builtins #5747

Merged
merged 26 commits into from
Aug 17, 2023
Merged

Add Inspect to builtins #5747

merged 26 commits into from
Aug 17, 2023

Conversation

rtfeldman
Copy link
Contributor

@rtfeldman rtfeldman commented Aug 11, 2023

No description provided.

@rtfeldman rtfeldman changed the title WIP: Inspect as builtin Add Inspect to builtins Aug 11, 2023
Alias(Symbol::INSPECT_ELEM_WALKER | Symbol::INSPECT_KEY_VAL_WALKER, _, var, _) => Self::from_var(env, var),

Alias(symbol, _, _, _) if symbol.is_builtin() => {
unreachable!("Need to special-case this builtin, like the ones above: {:?}", symbol);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out some builtins need to be handled differently from others. Before this change, we were getting errors where Inspect.ElemWalker was specializing to have 3 symbols but 0 layouts because its layout was incorrectly being cached as a 0-arg thunk.

Added this unreachable! so that if this happens again in the future, it will be clearer where to apply the fix!

rtfeldman and others added 5 commits August 14, 2023 18:58
Keep getting errors in the build ruby example on
Json, and it doesn't tell me the name of the
symbol, just the IdentId, which makes this
really hard to track down.

This approach works fine, it'll just be harder
to debug the next time we run into a special
case like ElemWalker.
Anton-4
Anton-4 previously approved these changes Aug 16, 2023
Copy link
Collaborator

@Anton-4 Anton-4 left a comment

Choose a reason for hiding this comment

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

I added some comments, tests and upgraded something to basic-cli 0.5. The rest looked good!

@rtfeldman rtfeldman merged commit 5ef2fc5 into main Aug 17, 2023
9 of 10 checks passed
@rtfeldman rtfeldman deleted the inspect-builtin branch August 17, 2023 12:43
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.

3 participants