aptos-core
aptos-core copied to clipboard
[Bug] Almost swapped lint does not detect swapping parameters
🐛 Bug
Consider the following code:
public fun needs_almost_swapped_warning(x: u64, y: u64): (u64, u64) {
x = y;
y = x;
(x, y)
}
The almost swapped lint (https://aptos.dev/en/build/smart-contracts/linter#almost_swapped) is supposed to emit a warning on this code, but it currently does not.
cc @JakeSilverman
This is likely because parameters in the model ASTs can be Temporary and not LocalVar.
This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.