fix problem in uniqueness inference

This commit is contained in:
Folkert 2020-10-02 01:08:37 +02:00
parent 2e1e87ad6a
commit a0c6952258
2 changed files with 9 additions and 2 deletions

View file

@ -1914,6 +1914,11 @@ fn annotation_to_attr_type(
arg_vars.extend(closure_vars); arg_vars.extend(closure_vars);
arg_vars.push(uniq_var); arg_vars.push(uniq_var);
match **closure {
Type::Variable(c) => arg_vars.push(c),
_ => unreachable!("closure must contain a type variable"),
}
( (
arg_vars, arg_vars,
attr_type( attr_type(

View file

@ -158,7 +158,7 @@ impl fmt::Debug for Type {
match self { match self {
Type::EmptyRec => write!(f, "{{}}"), Type::EmptyRec => write!(f, "{{}}"),
Type::EmptyTagUnion => write!(f, "[]"), Type::EmptyTagUnion => write!(f, "[]"),
Type::Function(args, _closure, ret) => { Type::Function(args, closure, ret) => {
write!(f, "Fn(")?; write!(f, "Fn(")?;
for (index, arg) in args.iter().enumerate() { for (index, arg) in args.iter().enumerate() {
@ -169,7 +169,9 @@ impl fmt::Debug for Type {
arg.fmt(f)?; arg.fmt(f)?;
} }
write!(f, " -> ")?; write!(f, " -")?;
closure.fmt(f)?;
write!(f, "-> ")?;
ret.fmt(f)?; ret.fmt(f)?;