aptos-core
aptos-core copied to clipboard
[Bug][Compiler-v2] Cannot check equality between mutable and immutable reference
🐛 Bug
After landing the PR #11371, the compiler V2 will generate an error when trying to check equality between mutable and immutable reference. For instance, for the following function:
fun t0(s: S, s_ref: &S) {
(&mut s == s_ref: bool);
}
The compiler will generate the error:
Diagnostics:
error: invalid call of `==`: mutability mismatch (&mut != &) for argument 2
┌─ tests/checking/typing/eq.move:18:20
│
18 │ (&mut s == s_ref: bool);
│ ^^^^^