Parse effectful arrow in function annotations

This commit is contained in:
Agus Zubiaga 2024-09-17 20:41:14 -03:00
parent 1a5776653c
commit ef4eeb5c1a
No known key found for this signature in database
30 changed files with 178 additions and 19 deletions

View file

@ -443,7 +443,8 @@ fn contains_unexposed_type(
Malformed(_) | Inferred | Wildcard | BoundVariable(_) => false,
Function(loc_args, loc_ret) => {
Function(loc_args, _arrow, loc_ret) => {
// [purity-inference] TODO: arrow
let loc_args_contains_unexposed_type = loc_args.iter().any(|loc_arg| {
contains_unexposed_type(&loc_arg.value, exposed_module_ids, module_ids)
});
@ -611,7 +612,8 @@ fn type_to_docs(in_func_type_ann: bool, type_annotation: ast::TypeAnnotation) ->
ast::TypeAnnotation::SpaceAfter(&sub_type_ann, _) => {
type_to_docs(in_func_type_ann, sub_type_ann)
}
ast::TypeAnnotation::Function(ast_arg_anns, output_ann) => {
ast::TypeAnnotation::Function(ast_arg_anns, _arrow, output_ann) => {
// [purity-inference] TODO: arrow
let mut doc_arg_anns = Vec::new();
for ast_arg_ann in ast_arg_anns {