summaryrefslogtreecommitdiffstats
path: root/tests/012/struct.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-07 06:29:07 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-07 06:29:07 -0700
commite6f1010ef967123bcc1046383d228dbae78bcde4 (patch)
treeec13b48e17e1c0d923d553604031b9ead835557d /tests/012/struct.tl
parent39f620152808fb3e8aedd4386b96491cc18331b8 (diff)
downloadtxr-e6f1010ef967123bcc1046383d228dbae78bcde4.tar.gz
txr-e6f1010ef967123bcc1046383d228dbae78bcde4.tar.bz2
txr-e6f1010ef967123bcc1046383d228dbae78bcde4.zip
expander: expand must only ignores unbound warnings.
The expand function must not muffle all deferred warnings. That causes the problem that a form like (inc var a.bar) fails to produce a warning due to bar not being the slot of any structure. The expand function must only muffle warnings about undefined functions and variables. * eval.c (muffle_unbound_warning): New static function. (no_warn_expand): Use muffle_unbound_warning as handler, rather than uw_muffle_warning. * tests/012/struct.tl: Fix two test cases here which test the expand function using a form that references a nonexistent slot. These now generate a warning, so we use the slot name b rather than d, which is defined. * txr.1: Documented change to expand.
Diffstat (limited to 'tests/012/struct.tl')
-rw-r--r--tests/012/struct.tl8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/012/struct.tl b/tests/012/struct.tl
index 57234913..3f03552d 100644
--- a/tests/012/struct.tl
+++ b/tests/012/struct.tl
@@ -43,10 +43,10 @@
(stest (ignwarn (expand 's.(a b c)))
"(call (slot s 'a)\n \
\ s b c)")
-(test (expand 's.[a].d)
- (slot [(slot s 'a) s] 'd))
-(test (expand 's.[a b c].d)
- (slot [(slot s 'a) s b c] 'd))
+(test (expand 's.[a].b)
+ (slot [(slot s 'a) s] 'b))
+(test (expand 's.[a b c].b)
+ (slot [(slot s 'a) s b c] 'b))
(set *gensym-counter* 0)
(stest (ignwarn (expand 's.(a).d))
"(slot (call (slot s 'a)\n \