Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Avoid using strings for exception_value of func_type #5710
Avoid using strings for exception_value of func_type #5710
Changes from 11 commits
4c0d095
3f29ce4
f3f3dd1
dab7347
b9fe05c
63dc932
9417b32
9666e11
30325f0
2562ad2
0ffd487
1abb981
9dd95fa
e49988c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding a
constant_result
as well, while we're at it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly unclear what this means.
I'll add
calculate_constant_result()
to the value before returning it, but it's possible I've missed the point here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to set the attribute (explicitly) when creating the node instance. Calling
calculate_constant_result()
is allowed to fail, so we should not use it outside of theConstantFolding
transform.You could pass the
constant_result
also as an optional argument into this method, so that callers can decide if and how to calculate it. Default should probably beconstant_value_not_set
. Or calculate it here based on the type and value.This is similar to
Parsing.wrap_compile_time_constant()
, BTW, although that has a slightly different focus. I'm not implying that there is room for reuse, though…