-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingfixed on masterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Description
Code:
global flag=false
function fun()
global flag
print(1)
if flag
flag_2=true
else
print(2)
if flag_2
print(3)
end
print(4)
end
print(5)
return true
end
fun()and I got
125true
Expected (as I replace the global flag with false):
global flag=false
function fun()
global flag
print(1)
if false
flag_2=true
else
print(2)
if flag_2
print(3)
end
print(4)
end
print(5)
return true
end
fun()and got
12ERROR: UndefVarError:
flag_2not defined
Stacktrace:
[1] fun()
@ Main .\REPL[2]:8
[2] top-level scope
@ REPL[3]:1
When definition of flag_2 is bypassed by the global flag, the code failed to raise an error and shouldn't continue running (as the number 5 printed)
Metadata
Metadata
Assignees
Labels
correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingfixed on masterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version