mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:51:16 +01:00
Clean up handling of Call params (#5061)
- Explicitly document that `*Param` and `*ParamPattern` insts represent `Call` parameters. - Stop wrapping compile-time parameter patterns in `ValueParamPattern` insts (because they aren't `Call` parameters). - Document how `MatchContext::results_` relates to the `Call` parameters, and be more consistent about when it's written to. - Remove `RuntimeParamIndex::Unknown`: we no longer need to distinguish "this `Param`'s runtime index is unknown" from "this `Param` isn't a runtime param", because we no longer use `Param`s at all in the latter case. - Rename `RuntimeParamIndex` to `CallParamIndex`. As a side effect of removing the `ValueParamPattern` insts, this fixes a minor diagnostic bug where `NoteInitializingParam` didn't identify the specific parameter that led to a deduction failure, because it expects generic parameters to only be represented by `SymbolicBindingPattern`s, but before this change they could be wrapped in `ValueParamPattern`s.
This commit is contained in:
+2
-2
@@ -29,9 +29,9 @@ fn F((a: {}, b: {}), c: {});
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %a.patt: %empty_struct_type = binding_pattern a
|
||||
// CHECK:STDOUT: %a.param_patt: %empty_struct_type = value_param_pattern %a.patt, runtime_param<unknown>
|
||||
// CHECK:STDOUT: %a.param_patt: %empty_struct_type = value_param_pattern %a.patt, runtime_param<none>
|
||||
// CHECK:STDOUT: %b.patt: %empty_struct_type = binding_pattern b
|
||||
// CHECK:STDOUT: %b.param_patt: %empty_struct_type = value_param_pattern %b.patt, runtime_param<unknown>
|
||||
// CHECK:STDOUT: %b.param_patt: %empty_struct_type = value_param_pattern %b.patt, runtime_param<none>
|
||||
// CHECK:STDOUT: %.loc15_19: %tuple.type = tuple_pattern (%a.param_patt, %b.param_patt)
|
||||
// CHECK:STDOUT: %c.patt: %empty_struct_type = binding_pattern c
|
||||
// CHECK:STDOUT: %c.param_patt: %empty_struct_type = value_param_pattern %c.patt, runtime_param0
|
||||
|
||||
Reference in New Issue
Block a user