Skip to content

inference: attach "Const.actual" flag to call instead of result type#37333

Merged
vtjnash merged 1 commit intomasterfrom
jn/const.notactual
Sep 3, 2020
Merged

inference: attach "Const.actual" flag to call instead of result type#37333
vtjnash merged 1 commit intomasterfrom
jn/const.notactual

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Sep 1, 2020

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.)

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.
@vtjnash vtjnash added the compiler:inference Type inference label Sep 1, 2020
@vtjnash vtjnash requested a review from Keno September 1, 2020 20:43
if val !== false
return CallMeta(val, info)
# TODO: add some sort of edge(s)
return CallMeta(val, MethodResultPure())
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:inference Type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants