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][move-compiler-v2] redundant and misspelled signer parameter error #13242

Closed
brmataptos opened this issue May 10, 2024 · 1 comment
Closed
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

brmataptos commented May 10, 2024

b# 🐛 Bug

&mut signer parameter to a view function yields 2 errors, leading to potential confusion. The second one is also misspelled ("paramter") making us look pkind of bad.

These both are generated in aptos-move/framework/src/extended_checks.rs and apply to the test in aptos-move/e2e-move-tests/src/tests/attributes.rs:

error: type `&mut signer` is not supported as a parameter type
  ┌─ /var/folders/hx/_s_6fyh529bgmvl6z4m8m9fm0000gn/T/.tmpRYTHVQ/sources/m.move:4:17
  │
4 │             fun view(_:&mut signer,value: u64): u64 { value }
  │                 ^^^^

error: view function cannot use the & signer paremter
  ┌─ /var/folders/hx/_s_6fyh529bgmvl6z4m8m9fm0000gn/T/.tmpRYTHVQ/sources/m.move:4:17
  │
4 │             fun view(_:&mut signer,value: u64): u64 { value }
  │                 ^^^^

test tests::attributes::test_view_attribute_with_mut_ref_signer - should panic ... ok

To reproduce:

UB=1 MOVE_COMPILER_V2=true cargo test -p e2e-move-tests -- test_view_attribute_with_mut_ref_signer

This also occurs without compiler-v2, so priority reduced.

@brmataptos brmataptos added bug Something isn't working compiler-v2 labels May 10, 2024
@brmataptos
Copy link
Contributor Author

Note that the entire phrase cannot use the & signer paremter is problematic in multiple ways. Better would be & signer is not supported as a parameter type to a view function.

@sausagee sausagee added the stale-exempt Prevents issues from being automatically marked and closed as stale label May 20, 2024
@brmataptos brmataptos self-assigned this May 22, 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

No branches or pull requests

2 participants