obj: add lightweight runtime typechecking