Skip to content

Commit

Permalink
Merge pull request #6892 from roc-lang/borrow-signature-tip
Browse files Browse the repository at this point in the history
added error tip
  • Loading branch information
Anton-4 authored Jul 10, 2024
2 parents 0d9db5b + 15a7ed2 commit b65e65f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/compiler/mono/src/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ impl<'state, 'a> State<'state, 'a> {
let borrow_signature =
match borrow_signatures.procs.get(&(name.name(), proc_layout)) {
Some(s) => s,
None => unreachable!("no borrow signature for {name:?} layout"),
None => unreachable!(
"\n\tNo borrow signature for {name:?} layout.\n\n\t\
Tip: This can happen when you call a function with less arguments than it expects.\n\t\
Like `Arg.list!` instead of `Arg.list! {{}}`"
)
};

for (argument, ownership) in arguments.iter().zip(borrow_signature.iter()) {
Expand Down

0 comments on commit b65e65f

Please sign in to comment.