iter 22b.2.1: add Constraint struct, Type::Forall.constraints
This commit is contained in:
@@ -191,8 +191,9 @@ pub(crate) fn qualify_local_types_codegen(
|
||||
param_modes: vec![],
|
||||
ret_mode: ParamMode::Implicit,
|
||||
},
|
||||
Type::Forall { vars, body } => Type::Forall {
|
||||
Type::Forall { vars, constraints, body } => Type::Forall {
|
||||
vars: vars.clone(),
|
||||
constraints: constraints.clone(),
|
||||
body: Box::new(qualify_local_types_codegen(body, owner_module, owner_local_types)),
|
||||
},
|
||||
Type::Var { .. } => t.clone(),
|
||||
@@ -216,7 +217,7 @@ pub(crate) fn apply_subst_to_type(t: &Type, subst: &BTreeMap<String, Type>) -> T
|
||||
param_modes: vec![],
|
||||
ret_mode: ParamMode::Implicit,
|
||||
},
|
||||
Type::Forall { vars, body } => {
|
||||
Type::Forall { vars, constraints, body } => {
|
||||
// Inner forall shadows: don't substitute re-bound names.
|
||||
let inner: BTreeMap<String, Type> = subst
|
||||
.iter()
|
||||
@@ -225,6 +226,7 @@ pub(crate) fn apply_subst_to_type(t: &Type, subst: &BTreeMap<String, Type>) -> T
|
||||
.collect();
|
||||
Type::Forall {
|
||||
vars: vars.clone(),
|
||||
constraints: constraints.clone(),
|
||||
body: Box::new(apply_subst_to_type(body, &inner)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user