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

Partial evaluator should not silently swallow errors #1125

Open
WardBrian opened this issue Feb 18, 2022 · 0 comments
Open

Partial evaluator should not silently swallow errors #1125

WardBrian opened this issue Feb 18, 2022 · 0 comments
Labels
cleanup Code simplification or clean-up good first issue Good for newcomers optimization

Comments

@WardBrian
Copy link
Member

If the partial evaluator replaces one function call with another, it checks that the new function is well-typed for it's arguments. This only seems to be there as a sanity check/safeguard against bad implementation of partial evaluation. This safeguard doesn't even check the return type is correct, just that the function is callable.

Non-function evaluations (such as when the result is evaluated all the way down to a literal value) are not checked at all.

If we'd like to keep this kind of check, it would be more useful throw an exception instead of silently suppressing the invalid partial evaluation.

Originally discussed with @nhuurre in #1115 (comment)

@WardBrian WardBrian added cleanup Code simplification or clean-up optimization labels Feb 18, 2022
@WardBrian WardBrian added the good first issue Good for newcomers label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code simplification or clean-up good first issue Good for newcomers optimization
Projects
None yet
Development

No branches or pull requests

1 participant