Skip to content

Commit

Permalink
Add a test for variable shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
lgyanf committed Oct 6, 2023
1 parent 48419e4 commit d63a821
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,18 @@ global b
global c
",
),
var_shadow: (
"var a = 1;
{
var a = a + 2;
print a;
}
print a;
",
Ok(()),
"3
1
"
),
);
}

0 comments on commit d63a821

Please sign in to comment.