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] No check on duplicated acquires #13145

Open
rahxephon89 opened this issue May 1, 2024 · 0 comments
Open

[Bug][Compiler-v2] No check on duplicated acquires #13145

rahxephon89 opened this issue May 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale

Comments

@rahxephon89
Copy link
Contributor

🐛 Bug

For the following code

module 0x8675309::A {
    use std::signer;
    struct T1 has key {v: u64}

    public fun test(account: &signer) acquires T1, T1 {
        borrow_global_mut<T1>(signer::address_of(account));
    }
}

V1 will generate the following error:

error[E02001]: duplicate declaration, item, or annotation
  ┌─ tests/move_check/translated_ir_tests/move/borrow_tests/borrow_global_acquires_duplicate_annotation.move:5:52
  │
5 │     public fun test(account: &signer) acquires T1, T1 {
  │                                                --  ^^ Duplicate acquires item
  │                                                │    
  │                                                Item previously listed here

But V2 does not generate any errors.

@rahxephon89 rahxephon89 added bug Something isn't working stale-exempt Prevents issues from being automatically marked and closed as stale compiler-v2 labels May 1, 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: For Grabs
Development

No branches or pull requests

2 participants