Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [Compiler-v2] error messages are unclear #9861

Closed
brmataptos opened this issue Aug 31, 2023 · 1 comment · Fixed by #12274
Closed

[Bug] [Compiler-v2] error messages are unclear #9861

brmataptos opened this issue Aug 31, 2023 · 1 comment · Fixed by #12274
Assignees
Labels
bug Something isn't working compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale

Comments

@brmataptos
Copy link
Contributor

🐛 Bug

The v2 compiler is currently producing error messages like the following, which are technically true descriptions of conflicts in a set of type constraints describing the program, but are not intuitive to less expert developers. We should re-visit these error messages and see if they can be clarified. Fortunately, most of these are now tagged with "(from assignment context)".

third_party/move/move-compiler-v2/tests/checking/typing/bind_wrong_type.exp:

error: expected `()` but found `integer` (from assignment context)
   ┌─ tests/checking/typing/bind_wrong_type.move:12:13
   │
12 │         let () = 0;
   │             ^^

error: expected `()` but found `u64` (from assignment context)
   ┌─ tests/checking/typing/bind_wrong_type.move:19:13
   │
19 │         let (): u64 = ();
   │      

error: expected 4 item(s), found 3
   ┌─ tests/checking/typing/bind_wrong_type.move:20:47
   │
20 │         let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0});
   │    

error: expected 4 item(s), found 3
   ┌─ tests/checking/typing/bind_wrong_type.move:20:13
   │
20 │         let (x, b, R{f}): (u64, bool, R, R) = (0, false, R{f: 0});
   │                                                    ^^^^^^^^^^^^^^^^^^^
@brmataptos brmataptos added the bug Something isn't working label Aug 31, 2023
@brmataptos brmataptos moved this from 🆕 New to 📋 Backlog in Move Language and Runtime Aug 31, 2023
@brmataptos
Copy link
Contributor Author

To link back to the relevant PR, here: #9792

@sausagee sausagee added the stale-exempt Prevents issues from being automatically marked and closed as stale label Sep 13, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Move Language and Runtime Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants