dedup part of tvars_to_tparams_for_type_alias_type and tvars_to_tparams_for_type_alias
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
```rs
fn tvars_to_tparams_for_type_alias_type(
```
and
```rs
fn tvars_to_tparams_for_type_alias(
```
Deal with three kind of legacy type parameters repeatedly.
how about a `LegacyTypeParamCollector` with
```rs
fn quantify_type_var(&mut self, tv: &TypeVar) -> Quantified;
fn quantify_type_var_tuple(&mut self, tvt: &TypeVarTuple) -> Quantified;
fn quantify_param_spec(&mut self, ps: &ParamSpec) -> Quantified;
fn quantify_type(&mut self, ty: &Type) -> Option;
```
Contributor guide
Research direction
Search for tvars_to_tparams_for_type_alias_type and tvars_to_tparams_for_type_alias, then compare how each handles the three legacy parameter kinds. Trace their callers and existing tests, if any, before deciding how the proposed LegacyTypeParamCollector API should cover the duplicated logic. Done means both entry points share the collector without changing their type-parameter results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100