swig/Examples/test-suite/ocaml/director_exception_nothrow_runme.ml
Zackery Spytz 35663b1622 [OCaml] Fix handling of exception specifications for director classes
The OCaml module was generating invalid code for director classes
which contain methods with exception specifications. The fix is based
on some of the code in python.cxx's classDirectorMethod().

This commit fixes compilation failures for a number of director unit
tests.

Add director_exception_catches_runme.ml,
director_exception_nothrow_runme.ml, and director_ignore_runme.ml.
2019-01-26 05:58:38 -07:00

12 lines
355 B
OCaml

open Swig
open Director_exception_nothrow
let _MyBar ob meth args =
match meth with
| "pang" -> C_string "_MyBar::pang()"
| _ -> (invoke ob) meth args
let a = new_derived_object new_Bar (_MyBar) '()
let _ = assert (_MyBar a "pang" '() as string = "_MyBar::pang()")
let b = new_Bar '()
let _ = assert (b -> pang () as string = "Bar::pang()")