Issue #3240524 by Xiaohua Guan, yas: Fix the variable whose name has already been declared previously without being used
Closes #3240524