make sure istype() is always present as an upvalue in the generated function