The OCaml module was generating dead code in the wrappers for overloaded functions. Only the generated dispatch function needs to allocate an array for the passed arguments. In addition, add overload_extend, overload_rename and overload_subtype runtime tests.
11 lines
272 B
OCaml
11 lines
272 B
OCaml
open Swig
|
|
open Overload_extend
|
|
|
|
let _ =
|
|
let f = new_Foo '() in
|
|
assert (f -> test () as int = 0);
|
|
assert (f -> test (3) as int = 1);
|
|
assert (f -> test ("hello") as int = 2);
|
|
assert (f -> test (3., 2.) as float = 5.);
|
|
assert (f -> test (3.) as float = 1003.)
|
|
;;
|