diff --git a/src/pretty_print_types.rs b/src/pretty_print_types.rs index 3c0567a20c..f0a503c5d5 100644 --- a/src/pretty_print_types.rs +++ b/src/pretty_print_types.rs @@ -39,7 +39,7 @@ fn write_flat_type(flat_type: FlatType, subs: &mut Subs, buf: &mut String, use_p for arg in args { buf.push_str(" "); - write_content(arg, subs, buf, true); + write_content(subs.get(arg).content, subs, buf, true); } if write_parens { diff --git a/src/solve.rs b/src/solve.rs index 00669559bf..cfa21181c0 100644 --- a/src/solve.rs +++ b/src/solve.rs @@ -94,13 +94,9 @@ fn type_to_variable(subs: &mut Subs, typ: Type) -> Variable { match typ { Variable(var) => var, Apply(module_name, name, arg_types) => { - let args: Vec = + let args: Vec = arg_types.into_iter() - .map(|arg| { - let var = type_to_variable(subs, arg); - - subs.get(var).content - }) + .map(|arg| type_to_variable(subs, arg)) .collect(); let flat_type = FlatType::Apply(module_name, name, args); diff --git a/src/subs.rs b/src/subs.rs index d40cc8cfa5..e80d3493e0 100644 --- a/src/subs.rs +++ b/src/subs.rs @@ -130,7 +130,7 @@ pub enum Content { #[derive(Clone, Debug, PartialEq, Eq)] pub enum FlatType { - Apply(String /* module name */, String /* type name */, Vec), + Apply(String /* module name */, String /* type name */, Vec), Func(Variable, Variable), EmptyRecord, } diff --git a/src/unify.rs b/src/unify.rs index fdb0ee266e..00e5ca5114 100644 --- a/src/unify.rs +++ b/src/unify.rs @@ -55,10 +55,11 @@ fn unify_flat_type(left: &FlatType, right: &FlatType) -> Descriptor { Apply(l_module_name, l_type_name, l_args), Apply(r_module_name, r_type_name, r_args) ) if l_module_name == r_module_name && l_type_name == r_type_name => { - let args = unify_args(l_args.iter(), r_args.iter()); - let flat_type = Apply(l_module_name.clone(), l_type_name.clone(), args); + panic!("TODO fix this by forking ena"); + // let args = unify_args(l_args.iter(), r_args.iter()); + // let flat_type = Apply(l_module_name.clone(), l_type_name.clone(), args); - from_content(Structure(flat_type)) + // from_content(Structure(flat_type)) }, (Func(_, _), Func(_, _)) => panic!("TODO unify_flat_type for Func"), _ => from_content(Error) diff --git a/tests/test_infer.rs b/tests/test_infer.rs index 8de94bc38b..a9d431cd1d 100644 --- a/tests/test_infer.rs +++ b/tests/test_infer.rs @@ -59,7 +59,7 @@ mod test_infer { (loc_expr.value, procedures) } - fn apply(module_name: &str, type_name: &str, args: Vec) -> Content { + fn apply(module_name: &str, type_name: &str, args: Vec) -> Content { Structure(FlatType::Apply(module_name.to_string(), type_name.to_string(), args)) }