test: add scope edge case tests for variable initialization and shadowing
Add four new test files covering variable scope edge cases: - global_in_initializer: verify global variable can reference itself in initializer - local_in_initializer: verify local variable referencing itself in initializer produces error - shadow_and_local: verify shadowed variable correctly resolves to outer scope before inner declaration - shadow_in_initializer: verify shadowed variable in initializer correctly references outer scope value
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
var a = "outer"
|
||||
{
|
||||
io.write(a) // expect: outer
|
||||
var a = "inner"
|
||||
io.write(a) // expect: inner
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user