File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -719,9 +719,29 @@ let check_stmt (cx:Semant.ctxt) : (fn_ctx -> Ast.stmt -> unit) =
719
719
None -> None
720
720
| Some arg -> Some (check_atom arg)
721
721
in
722
+ let rec replace_args ty =
723
+ match ty with
724
+ Ast. TY_fn (ty_sig , ty_fn_aux ) ->
725
+ let orig_slots = ty_sig.Ast. sig_input_slots in
726
+ let take_arg i =
727
+ match args.(i) with
728
+ None -> Some orig_slots.(i)
729
+ | Some _ -> None
730
+ in
731
+ let new_slots = Array. init (Array. length args) take_arg in
732
+ let new_slots = Common. arr_filter_some new_slots in
733
+ let ty_sig =
734
+ { ty_sig with Ast. sig_input_slots = new_slots }
735
+ in
736
+ Ast. TY_fn (ty_sig, ty_fn_aux)
737
+ | Ast. TY_mutable ty' -> Ast. TY_mutable (replace_args ty')
738
+ | Ast. TY_constrained (ty' , constrs ) ->
739
+ Ast. TY_constrained (replace_args ty', constrs)
740
+ | _ -> Common. bug () " replace_args: unexpected type"
741
+ in
722
742
let callee_ty = check_lval callee in
723
743
ignore (demand_fn (Array. map check_arg args) callee_ty);
724
- infer_lval callee_ty bound
744
+ infer_lval (replace_args callee_ty) bound
725
745
726
746
| Ast. STMT_recv (dst , src ) ->
727
747
infer_lval (demand_port (check_lval src)) dst
You can’t perform that action at this time.
0 commit comments