inference: attach "Const.actual" flag to call instead of result type#37333
Merged
inference: attach "Const.actual" flag to call instead of result type#37333
Conversation
It was not a property of the type-lattice but of the call, so it was a bit odd to track in this type (since it should not propagate). Instead, we can attach this to the stmt_info field now, where inlining will find it when needed.
Keno
reviewed
Sep 1, 2020
| if val !== false | ||
| return CallMeta(val, info) | ||
| # TODO: add some sort of edge(s) | ||
| return CallMeta(val, MethodResultPure()) |
Member
There was a problem hiding this comment.
Other future consumers of stmt info (e.g. Cthulhu) may want to look at the info here, probably, but since that's not ready yet, I think we can cross that bridge when we get there.
Member
Author
There was a problem hiding this comment.
Sure, but when we hit a call we think might be pure because of info, we're then ignoring the actual info when we do the pure_eval_call, so I think this is actually a bit more accurate.
Keno
approved these changes
Sep 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Been wanting to fix this for a long time, but finally it has become convenient.
"Const.actual" was not a property of the type-lattice but of the call, so it was a bit odd to track in this type (since it should not propagate). Instead, we can attach this to the stmt_info field now, where inlining will find it when needed.
(Possibly somewhat related to #33753 also.)