Merge branch 'ZackerySpytz-OCaml-error-msg-incorrect-overloaded-call'
* ZackerySpytz-OCaml-error-msg-incorrect-overloaded-call: [OCaml] Improve the error message for incorrect overloaded function calls
This commit is contained in:
commit
6634016962
1 changed files with 12 additions and 1 deletions
|
|
@ -733,7 +733,18 @@ public:
|
|||
"argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );\n"
|
||||
"for( i = 0; i < argc; i++ ) {\n" " argv[i] = caml_list_nth(args,i);\n" "}\n", NIL);
|
||||
Printv(df->code, dispatch, "\n", NIL);
|
||||
Printf(df->code, "caml_failwith(\"No matching function for overloaded '%s'\");\n", iname);
|
||||
Node *sibl = n;
|
||||
while (Getattr(sibl, "sym:previousSibling"))
|
||||
sibl = Getattr(sibl, "sym:previousSibling");
|
||||
String *protoTypes = NewString("");
|
||||
do {
|
||||
String *fulldecl = Swig_name_decl(sibl);
|
||||
Printf(protoTypes, "\n\" %s\\n\"", fulldecl);
|
||||
Delete(fulldecl);
|
||||
} while ((sibl = Getattr(sibl, "sym:nextSibling")));
|
||||
Printf(df->code, "caml_failwith(\"Wrong number or type of arguments for overloaded function '%s'.\\n\""
|
||||
"\n\" Possible C/C++ prototypes are:\\n\"%s);\n", iname, protoTypes);
|
||||
Delete(protoTypes);
|
||||
Printv(df->code, "}\n", NIL);
|
||||
Wrapper_print(df, f_wrappers);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue