concordium-rust-smart-contracts
concordium-rust-smart-contracts copied to clipboard
Improve error reporting when `mutable` is used incorrectly
Task description
Currently if the user does not use the mutable attribute on a receive entrypoint, but has &mut impl HasHost<...> as the type of the host the error message is quite bad and talks about internals that are not exposed to the user.
It would be good to improve on this. In general we cannot do much since users can define aliases for &mut impl HasHost<...> or use more specific types there. However probably in the most common case we could improve the message.
If the user writes &mut _ at the argument position and they have not used mutable then that is definitely an error and we can produce a nice error message.