Print better error messages when the number of type params is wrong

This commit is contained in:
Patrick Walton 2010-10-20 11:22:44 -07:00
parent 28d43678b6
commit 4bb675ba42

View File

@ -978,7 +978,12 @@ let rec rebuild_ty_under_params
(resolve_names:bool)
: Ast.ty =
if (Array.length params) <> (Array.length args)
then err None "mismatched type-params"
then
err None
"mismatched type-params: %s has %d param(s) but %d given"
(Ast.sprintf_ty () ty)
(Array.length params)
(Array.length args)
else
let nmap = Hashtbl.create (Array.length args) in
let pmap = Hashtbl.create (Array.length args) in