search for: invalid_cast

Displaying 2 results from an estimated 2 matches for "invalid_cast".

Did you mean: invalid_cases
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
...ers which play the same role as bool T::isa<U>(T*), U* T::cast<U>(T*), and U* T::dyn_cast<U>(T*): (** @see [bool Type::isa<FunctionType>(Type*)] *) val is_function_type : lltype t -> bool (** @see [FunctionType *Type::dyn_cast<FunctionType>(Type*)] @raise Invalid_cast if the conversion is impossible. *) val as_function_type : lltype t -> `FunctionTy t For Value, it will be important to push the ISA routines through all of the layers (esp. for Value), but I think you can implement ISA routines in Ocaml relatively painlessly for Type. > Here's the...
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with coming up with a way to improve the ocaml binding's type safety. We can't go letting haskell beat us now, can we? I think I got an easy solution with phantom types. For those who don't know what the problem is, the ocaml bindings share one type between whole class branches (like values). This means we need to downcast