Improve use error messages with the expanded code
#5107
sobolevn
started this conversation in
Ideas & suggestions
Replies: 2 comments
-
|
It doesn't look so bad with this trivial example (if a bit verbose), but in real code it could produce hundreds of lines of code, resulting in an impossible to read error message. How might we deal with that? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Maybe we can do collapse some lines like in inexhaustive pattern error: Or, how Rust sows error message for both mutable and immutable borrow: So, error message for your sample code may be something like this: The main concern here is how we should display skipped lines? Maybe we also want to show line numbers here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
useis a rather new concept in programming languages. It is rather hard to understand.When getting an error, it is not really clear how to solve it.
Example of an invalid code:
Produces:
It would be awesome to see this:
How hard would it be? What do others think - is it useful?
Beta Was this translation helpful? Give feedback.
All reactions