swig/Examples/test-suite/ocaml/overload_extend_runme.ml
Zackery Spytz fa1a0a378c [OCaml] Fix dead code generation in overloaded function wrappers
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.
2019-01-16 20:00:40 -07:00

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.)
;;