Optimize variable shadowing.

This commit is contained in:
Stephen Chung
2022-02-18 15:04:46 +08:00
parent 83786c992b
commit bb04fab011
10 changed files with 137 additions and 58 deletions

View File

@@ -748,7 +748,7 @@ impl AST {
if options.contains(AST_OPTION_CONSTANT) && include_constants
|| !options.contains(AST_OPTION_CONSTANT) && include_variables =>
{
let (name, expr) = x.as_ref();
let (name, expr, ..) = x.as_ref();
if let Some(value) = expr.get_literal_value() {
Some((name.as_str(), options.contains(AST_OPTION_CONSTANT), value))
} else {