swig/Examples/test-suite/ocaml/director_unroll_runme.ml
Zackery Spytz 28a846705f [OCaml] Fix possible GC issues in generated director code
Make `classDirectorMethod()` generate `CAMLreturn_type()` or
`CAMLreturn0` when there are local variables of type `value`.
2019-02-07 22:08:10 -07:00

15 lines
354 B
OCaml

open Swig
open Director_unroll
let director_unroll_MyFoo ob meth args =
match meth with
| "ping" -> C_string "MyFoo::ping()"
| _ -> (invoke ob) meth args
let a = new_derived_object
new_Foo (director_unroll_MyFoo) '()
let b = new_Bar '()
let _ = b -> set (a)
let c = b -> get ()
let _ = assert ((a -> "&" () as int) = (c -> "&" () as int))