Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] w_typer: use eqType on hints

  • Loading branch information...
commit 26d1e5f14c9546e890f61a2598948d38b7e268d3 1 parent c8280b1
Niki Vazou authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 compiler/libqmlcompil/typer_w/w_ReportErrors.ml
View
6 compiler/libqmlcompil/typer_w/w_ReportErrors.ml
@@ -100,13 +100,17 @@ let counting_ending n =
else if n = 3 then "rd"
else "th"
+let eqType t1 t2 =
+ try W_Unify.unify_simple_type W_TypingEnv.empty_typing_env t1 t2; true
+ with _ -> false
+
let rec __hint_compare_fun_arguments ppf (real_args, tmp_args, n) =
match (real_args, tmp_args) with
| ([], []) -> ()
| (real_ty::real_tys, applied_ty::applied_tys) ->
let real_ty = W_CoreTypes.simple_type_repr real_ty in
let applied_ty = W_CoreTypes.simple_type_repr applied_ty in
- if (real_ty = applied_ty)
+ if (eqType real_ty applied_ty)
then __hint_compare_fun_arguments ppf (real_tys, applied_tys, n+1)
else Format.fprintf ppf
("@\n@[<2>@{<bright>Hint@}:@\nFunction expects a %d%s-argument " ^^
Please sign in to comment.
Something went wrong with that request. Please try again.