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

bootstrap: Handle unavailable Base._return_type #57637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

topolarity
Copy link
Member

Make sure not to MethodError if anyone tries to call ntuple(...) in Compiler

This is easily encountered during a bootstrap if you happen to execute,
e.g., `ntuple(...)` at the right time.
@topolarity topolarity requested a review from Keno March 4, 2025 13:37
@topolarity topolarity changed the title bootstrap: Handle unavailable _return_type bootstrap: Handle unavailable Base._return_type Mar 4, 2025
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

This appears to affect the soundness of compilation, so is not safe to merge (throw is okay, but not return)

@topolarity
Copy link
Member Author

topolarity commented Mar 4, 2025

This appears to affect the soundness of compilation, so is not safe to merge (throw is okay, but not return)

The throw is unhandled, so it just causes bootstrapping to fail. What's the right fix?

@topolarity
Copy link
Member Author

topolarity commented Mar 4, 2025

I can instead catch and widen at all of the uses in Base, so that we're not conflicting with the tfunc here but that will penalize non-bootstrapping code for no reason...

Is it possible for us to distinguish the bootstrapping typeinf world (the case I hit it was 1) and use that to be sound and also not crash during bootstrapping?

@vtjnash
Copy link
Member

vtjnash commented Mar 4, 2025

World 1 is not a legal world to run in (it is used in various places to indicate a bug occurred in setting the value correctly)

Yes, we could probably define a different method that just returns Any, then replace it after the compiler worlds with the magic one

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