Fix typecheck for `error` builtin