iter 22b.3.3: collect_mono_targets — synth-replay residual gathering

This commit is contained in:
2026-05-09 20:31:12 +02:00
parent c77fd1b85e
commit 89311ee20b
3 changed files with 222 additions and 3 deletions
+2 -2
View File
@@ -123,7 +123,7 @@ fn instantiate(forall_vars: &[String], body: &Type, counter: &mut u32) -> (Vec<T
/// Substitutes named rigid vars throughout a type (used by
/// `instantiate`). Unlike `Subst::apply`, this targets vars by name —
/// it has no notion of metavar ids.
fn substitute_rigids(t: &Type, mapping: &BTreeMap<String, Type>) -> Type {
pub(crate) fn substitute_rigids(t: &Type, mapping: &BTreeMap<String, Type>) -> Type {
match t {
Type::Var { name } => mapping.get(name).cloned().unwrap_or_else(|| t.clone()),
Type::Con { name, args } => Type::Con {
@@ -1436,7 +1436,7 @@ fn check_fn(f: &FnDef, env: &Env) -> Result<()> {
/// the no-instance lookup — anything carrying a metavar / rigid-var
/// component is either covered by the missing-constraint check or
/// genuinely under-specified at the call site.
fn is_fully_concrete(t: &Type) -> bool {
pub(crate) fn is_fully_concrete(t: &Type) -> bool {
match t {
Type::Con { args, .. } => args.iter().all(is_fully_concrete),
Type::Var { .. } => false,