Browse Source

[typer] warn about uninferred function argument types (see #3033)

Simon Krajewski 7 years ago
parent
commit
85a973ed7d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/typing/typeload.ml

+ 3 - 0
src/typing/typeload.ml

@@ -2580,6 +2580,9 @@ module ClassInitializer = struct
 					| _ ->
 						let e , fargs = type_function ctx args ret fmode fd fctx.is_display_field p in
 						if fctx.is_override then check_overriding ctx c cf;
+						List.iter (fun (v,_) ->
+							if v.v_name <> "_" && has_mono v.v_type then ctx.com.warning "Uninferred function argument, please add a type-hint" v.v_pos;
+						) fargs;
 						let tf = {
 							tf_args = fargs;
 							tf_type = ret;