itry to fix
Does not break any tests. But has to be check deeper to besure it does not cause unexpected type var to term var transformation.
@@ -88,7 +88,8 @@ impl TryFrom<UniTerm> for RichTerm {
let rt = match node {
UniTermNode::Var(id) => RichTerm::new(Term::Var(id), pos),
UniTermNode::Record(r) => RichTerm::try_from(r)?,
- UniTermNode::Types(ty) => {
+ UniTermNode::Types(mut ty) => {
+ fix_type_vars(&mut ty);
ty.contract().map_err(|UnboundTypeVariableError(id)| {
// We unwrap the position of the identifier, which must be set at this stage of parsing
let pos = id.pos;
@@ -351,8 +352,8 @@ pub fn fix_type_vars(ty: &mut Types) {
| AbsType::Bool()
| AbsType::Str()
| AbsType::Sym()
- | AbsType::Flat(_)
| AbsType::RowEmpty()
+ | AbsType::Flat(_)
| AbsType::Wildcard(_) => (),
AbsType::Arrow(ref mut s, ref mut t) => {
fix_type_vars_aux(s.as_mut(), Cow::Borrowed(bound_vars.as_ref()));
