aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-11 21:08:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-11 21:08:06 -0700
commit51ca241352218e6da8db10fe07c90e229a0bc1f8 (patch)
tree3e8b4e28353bdb5b64f182737127a524b8e0e299 /test
parent3dd49d281145d457bf8fa834418c2a7ff38250bd (diff)
downloadegawk-51ca241352218e6da8db10fe07c90e229a0bc1f8.tar.gz
egawk-51ca241352218e6da8db10fe07c90e229a0bc1f8.tar.bz2
egawk-51ca241352218e6da8db10fe07c90e229a0bc1f8.zip
@let: bug re-using previously scalar location as array.
* test/let1.awk: New test case. * interpret.h (r_interpret): Our new Op_clear_var opcode should not only assign the null value to the variable, but reset its type to Node_var_new.
Diffstat (limited to 'test')
-rw-r--r--test/let1.awk7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/let1.awk b/test/let1.awk
index 94a1a681..431fb8b8 100644
--- a/test/let1.awk
+++ b/test/let1.awk
@@ -38,6 +38,13 @@ BEGIN {
print "b3", l3 "-" x
}
+# test re-use of scalar var as array
+
+BEGIN {
+ @let (i = 3) { }
+ @let (a) { a[0] = 42 }
+}
+
# test clearing uninitialized variables
function f4()