[LLVMdev] improving the ocaml binding's type safety

Erick Tryzelaar idadesub at users.sourceforge.net
Sat Mar 15 16:17:07 PDT 2008


On Sat, Mar 15, 2008 at 4:00 PM, Gordon Henriksen
<gordonhenriksen at mac.com> wrote:
> What do the respective type errors look like?

Top down looks like:

File "foo.ml", line 21, characters 11-36:
This expression has type Bar.llglobalvariable Bar.t
but is here used with type ([> `Function ] as 'a) Bar.t
Type Bar.llglobalvariable = [ `GlobalValue | `GlobalVariable | `Value ]
is not compatible with type 'a
The first variant type does not allow tag(s) `Function

Bottom up looks like:

File "foo.ml", line 21, characters 11-36:
This expression has type Bar.llglobalvariable Bar.t
but is here used with type ([< Bar.llfunction ] as 'a) Bar.t
Type Bar.llglobalvariable = [ `GlobalVariable ] is not compatible with type
  'a = [< `Function ]
These two variant types have no intersection



More information about the llvm-dev mailing list