inline checkArgument function.