Skip to content

Commit

Permalink
fix(multimethods): show multimethod's name in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Samy-33 committed Nov 4, 2024
1 parent 8166273 commit fcb67ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler+runtime/src/cpp/jank/runtime/obj/multi_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ namespace jank::runtime
{
throw std::runtime_error{ fmt::format(
"Preference conflict in multimethod '{}': {} is already preferred to {}",
name,
runtime::to_string(name),
runtime::to_string(y),
runtime::to_string(x)) };
}
Expand Down Expand Up @@ -304,7 +304,7 @@ namespace jank::runtime
if(target == obj::nil::nil_const())
{
throw std::runtime_error{ fmt::format("No method in multimethod '{}' for dispatch value: {}",
name,
runtime::to_string(name),
runtime::to_string(dispatch_val)) };
}
return target;
Expand Down Expand Up @@ -350,7 +350,7 @@ namespace jank::runtime
throw std::runtime_error{ fmt::format(
"Multiple methods in multimethod '{}' match dispatch value: {} -> {} and {}, and "
"neither is preferred",
name,
runtime::to_string(name),
runtime::to_string(dispatch_val),
runtime::to_string(entry_key),
runtime::to_string(best_entry->first())) };
Expand Down

0 comments on commit fcb67ed

Please sign in to comment.