-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Clean up handling of Call
params
#5061
Conversation
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.
Generally looks good, two minor comments.
// parameters" terminology in EntityWithParamsBase. | ||
struct RuntimeParamIndex : public IndexBase<RuntimeParamIndex> { | ||
// `Call` parameter index. | ||
struct CallParamIndex : public IndexBase<CallParamIndex> { | ||
static constexpr llvm::StringLiteral Label = "runtime_param"; |
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.
Do you want to change this here? Or maybe useful to do in a follow-up patch to isolate the noisy churn?
(If in a follow-up, leave a TODO for this PR?)
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.
Good catch, yes, we should change this. This PR was already supposed to isolate the noisy churn of dropping all those value_param_pattern
s (although I admit there's been some scope creep), so it seems simpler to take care of this now.
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.
So, having seen this, I think it would be better to do this in a follow-up PR. Changing this changes essentially every test file, where-as without this there was a fairly reasonable subset of tests really impacted by the change.
I'm approving, but I'd suggest undoing this and leaving a TODO and having a PR that does just this rename so that it's a bit more isolated. Otherwise, for example, I don't think I could find the interesting diagnostic change in the output.
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.
OK, done.
...a/builtin_conversions/no_prelude/fail_convert_facet_value_shouldnt_know_concrete_type.carbon
Show resolved
Hide resolved
// parameters" terminology in EntityWithParamsBase. | ||
struct RuntimeParamIndex : public IndexBase<RuntimeParamIndex> { | ||
// `Call` parameter index. | ||
struct CallParamIndex : public IndexBase<CallParamIndex> { | ||
static constexpr llvm::StringLiteral Label = "runtime_param"; |
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.
So, having seen this, I think it would be better to do this in a follow-up PR. Changing this changes essentially every test file, where-as without this there was a fairly reasonable subset of tests really impacted by the change.
I'm approving, but I'd suggest undoing this and leaving a TODO and having a PR that does just this rename so that it's a bit more isolated. Otherwise, for example, I don't think I could find the interesting diagnostic change in the output.
*Param
and*ParamPattern
insts representCall
parameters.ValueParamPattern
insts (because they aren'tCall
parameters).MatchContext::results_
relates to theCall
parameters, and be more consistent about when it's written to.RuntimeParamIndex::Unknown
: we no longer need to distinguish "thisParam
's runtime index is unknown" from "thisParam
isn't a runtime param", because we no longer useParam
s at all in the latter case.RuntimeParamIndex
toCallParamIndex
.As a side effect of removing the
ValueParamPattern
insts, this fixes a minor diagnostic bug whereNoteInitializingParam
didn't identify the specific parameter that led to a deduction failure, because it expects generic parameters to only be represented bySymbolicBindingPattern
s, but before this change they could be wrapped inValueParamPattern
s.