Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/util/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ inline void consume_io_result(object * o) {
dec(o);
}

template<typename T> T get_io_scalar_result(object * o) {
inline uint32 get_io_uint32_result(object * o) {
if (io_result_is_error(o)) {
object * err_obj = io_result_get_error(o);
inc(err_obj);
dec(o);
string_ref error(lean_io_error_to_string(err_obj));
throw exception(error.to_std_string());
} else {
T r = unbox(io_result_get_value(o));
uint32 r = unbox_uint32(io_result_get_value(o));
dec(o);
return r;
}
Expand Down
4 changes: 2 additions & 2 deletions src/util/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ int run_shell_main(int argc, char* argv[], object_ref const & shell_opts) {
argc--;
args = list_ref<string_ref>(string_ref(argv[argc]), args);
}
return get_io_scalar_result<uint32>(lean_shell_main(
return get_io_uint32_result(lean_shell_main(
args.steal(),
shell_opts.to_obj_arg()
));
Expand All @@ -239,7 +239,7 @@ bool process_shell_option(object_ref & shell_opts, int opt, char const * optarg,
dec_ref(r);
return false;
} else {
rc = unbox(io_result_get_error(r));
rc = unbox_uint32(io_result_get_error(r));
dec_ref(r);
return true;
}
Expand Down
Loading