Enrich constructor parameters from ancestor parameters, matched by name. Unlike regular methods (which follow Liskov substitution and can safely use positional matching), constructors can have completely different signatures. Only parameters with the **same name** in both the child and ancestor are enriched.
(
existing_params: &mut [ParameterInfo],
ancestor_params: &[ParameterInfo],
)
| 235 | /// different signatures. Only parameters with the **same name** in |
| 236 | /// both the child and ancestor are enriched. |
| 237 | fn enrich_constructor_parameters_by_name( |
| 238 | existing_params: &mut [ParameterInfo], |
| 239 | ancestor_params: &[ParameterInfo], |
| 240 | ) { |
| 241 | for existing_param in existing_params.iter_mut() { |
| 242 | if let Some(ancestor_param) = ancestor_params |
| 243 | .iter() |
| 244 | .find(|ap| ap.name == existing_param.name) |
| 245 | { |
| 246 | enrich_single_parameter(existing_param, ancestor_param); |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /// Enrich a single child parameter from an ancestor parameter. |
| 252 | /// |
no test coverage detected