ocaml-ctypes icon indicating copy to clipboard operation
ocaml-ctypes copied to clipboard

Better uncoercible error messages/failure time

Open dsheets opened this issue 9 years ago • 0 comments
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.

dsheets avatar Dec 22 '15 17:12 dsheets