swig/Examples/test-suite/ocaml/director_ignore_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

18 lines
523 B
OCaml

open Swig
open Director_ignore
let _DIgnoresDerived ob meth args =
match meth with
| "OverloadedMethod" -> C_int 0
| _ -> (invoke ob) meth args
let a =new_derived_object new_DIgnores (_DIgnoresDerived) '()
let _ = assert (a -> Triple (5) as int = 15)
let _DAbstractIgnoresDerived ob meth args =
match meth with
| "OverloadedMethod" -> C_int 0
| _ -> (invoke ob) meth args
let a = new_derived_object new_DAbstractIgnores (_DAbstractIgnoresDerived) '()
let _ = assert (a -> Quadruple (5) as int = 20)