ocaml-ctypes
ocaml-ctypes copied to clipboard
Better uncoercible error messages/failure time
trafficstars
When writing functions that coerce from one type to another, especially in cross-platform bindings, it is common to have a type mismatch in coercions. Currently, this error manifests as a run-time exception: Ctypes_coerce.Uncoercible.
This exception does not have enough information to be useful. Additionally, it should be possible to move many coercions to compile-time with stub gen so static run-time coercions don't potentially result in run-time exceptions.