Our current implementation of typeOf
(class Typed
in LLVM.AST.Typed
) has a problem: if the type resolution logic encounters an opaque structure type, typeOf
throws an error and bails.
This can happen any time someone asks for the type of something resulting from a getelementptr
instruction.
This is problematic because it doesn't allow the user to gracefully handle the failure of type resolution. typeOf
should really be returning a Maybe Type
instead of returning a Type
and throwing an error if that type can't be resolved.