aptos-core
aptos-core copied to clipboard
[Feature Request] Extend equality optimizations to cover reference-based operations.
Compiler (tested on V2) will optimize
public fun eq1(): bool {
1 == 1
}
to
public fun eq1(): bool {
true
}
However, it compiles
public fun eq2(): bool {
&1 == &1
}
to
public fun eq2(): bool {
Eq<u64>(Borrow(Immutable)(1), Borrow(Immutable)(1))
}
Consider extending the optimizations to cover reference-based operations.